Time limit
50000 ms
Memory limit
262144 kB
OS
Linux
Source
HAOI2011
Descriptions:

Problem b

HYSBZ - 2301