f :: Int -> Int
f x = x * x

solve :: Int -> Int
solve d = (d*) $ sum $ map f [0 , d .. 600 - d]

main :: IO ()
main  = getContents
    >>= return . map read . lines
    >>= return . map solve
    >>= mapM_ print