#P11874. Balanced Monkey Soldiers

    ID: 13976 Type: Default 1000ms 256MiB

Balanced Monkey Soldiers

Balanced Monkey Soldiers

As you see, this is not a simple construction problem.

Xiaowei, a destined person with an infinite number of hairs, can transform each hair into a monkey soldier. However, the monkey soldiers he summons are standing on the unstable surface of an inverted conical mountain. To prevent the mountain from collapsing, Xiaowei must position the monkey soldiers on specific grid points so that their center of mass coincides with the support point B(\(x, y\)).

There are currently k monkey soldiers, each of equal mass. The soldiers must be placed at distinct integer coordinate points \((x_i,y_i)\) with \(-2\times10^9 \le x_i,y_i \le 2\times10^9\). In addition, due to precision settings, a soldier can only stand on a grid point (both coordinates are integers) and no two soldiers may share the same coordinate.

The center of mass of the monkey soldiers is given by
\[ \left(\frac{\sum_{i=1}^{k}x_i}{k},\,\frac{\sum_{i=1}^{k}y_i}{k}\right) = B(x,y) . \]

Determine whether it is possible to choose k distinct grid points that satisfy the bound and such that their center of mass is exactly \(B(x,y)\).

inputFormat

The input consists of a single line containing three space-separated integers: x, y and k, where \(B(x,y)\) is the support point and k is the number of monkey soldiers.

outputFormat

Output a single line: YES if it is possible to place the monkey soldiers satisfying the given conditions, and NO otherwise.

sample

0 0 1
YES