ACM is fun, enjoy it anyway. Please allow me to introduce myself first. I’m Tao Wu. Yes, I’m now standing in the front of the room. But, don't look at me, haha. Image processing is one of my favorite interests. Then, I will chat with you about QR, ‘二维码’ in Chinese.
QR code, or Quick Response code, is a type of readable code originally used to track automotive parts. It is mostly limited in Japan and South Korea for several years but now, it is gaining attention worldwide. Currently, QR code is mainly utilized to advertise site/product offline.
With smart-phones and other mobile gadgets which governed the modern world, QR code can be scanned by them easily, which makes it a real convenient storage of information. Data that can be encoded in a QR code ranges from a simple e-mail address, a simple text, to long winding web addresses, phone numbers, and even PayPal information.
A Quick Response code is a two-dimensional pictographic code used for its fast readability and comparatively large storage capacity. The code consists of black modules arranged in a square pattern on a white background. The information encoded can be made up of any kind of data (e.g., binary, alphanumeric, or Kanji symbols)
Until now, do you still not understand? Please see the figure below!
There is a very beautiful country called ICPC (International Cleanest and Prettiest Country). It is really clean and pretty, but not so convenient in mobile network. This year, you are hired to take the following task called ACM (A Coding Method) for QR code.
There are N rows and N cols in the image, and N is the size of this image. When the QR code image is initialized, each pixel is denoted by circle. Then you are asked to fill the circle with one black point when you generate the QR code image. The schedule must follow these rules:
The direction is from right to left,
Each row is filled with a number of black points,
And the number is equal to the line number.
The final result is as the QR code image by ACM.
There is an example, in which N is 5. Please see the figure below!
There is one black point in the 1st row.
There are two black points in the 2nd row.
There are three black points in the 3rd row.
There are four black points in the 4th row.
There are five black points in the 5th row.
Thus, the number of the black points is 1+2+3+4+5=15.
Here comes the problem: What’s the number of black points you need to add to obey these rules of ACM?