B. Maxim Buys an Apartment time limit per test 1 second memory limit per test 512 megabytes input standard input output standard output