The hold of a barge has the shape of a square with side (C = 1..1000), divided into unit squares (cells) numbered from left to right, row by row. Each cell contains flammable cargo. Exactly at midnight, due to lightning, the cell with number catches fire. Each cell burns for minute, and then the fire spreads to all neighboring cells that share a side. How many hours () and minutes () does the fire last until all the cargo is completely burned?
Two positive integers are given: and (N = 1..C^2).
Output two non-negative integers and (the number of hours and minutes).
Example 1