The official statement of a problem is always the one in the PDF document. The HTML and PNG versions of the statement are also given to help you, but they may contain some content that is not well displayed. In case of doubt, always use the PDF.
Input
736 291 291
Output
1318
12 -569 666
109
-7 10 -3
0
11 22 3114
3147