When thinking about a hard problem a lot of people like to doodle, to create \an unfocused drawing that can help the memory and improve abstract thinking". The most basic form of doodle is a repetitive pattern covering the whole page.
One way to create such a pattern is to take a graphing paper and start in the top-left corner (0,0) and fill out the square, then move down and right one square (1,1), fill it out, and so on. Every time you hit the edge of the paper you reverse direction, until you are back at the starting point. This will create a very soothing pattern.
However, to ensure you don't spend the whole competition doodling you need to figure out how how many squares you will have to fill in the paper to complete the doodle before you even start doodling.
입력 3 11 3 5 7 5 8 출력 11 12 20
출처:ncpc/2010/ Problem E