• + 0 comments

    Haskell

    module Main where
    
    import Control.Monad (replicateM_)
    
    main :: IO ()
    main = do
        cases <- readLn :: IO Int
        replicateM_ cases $ do
            n <- readLn :: IO Integer
            let (q, r) = n `quotRem` 2
            print $ q * (q + r)