home *** CD-ROM | disk | FTP | other *** search
- main = appendChan stdout (answer 3) exit done
-
- answer n = unlines (map (concat . map (pad 8 . show) . worker) bs)
- where bs = [ (x,y) | x<-xs, y<-xs ]
- xs = [-n .. -1] ++ [1..n]
-
- worker (n,m) = [ n, m, n`div`m, n`mod`m, n`quot`m, n`rem`m ]
-
- pad n s = iterate (' ':) s !! (n - length s)
-
-