当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。
Write a program that, given three positive integers x, y and z (x, y, z < 232, x ≤ y), computes the bitwise exclusive disjunction (XOR) of the arithmetic progression x, x + z, x + 2z, …, x + kz, where k is the largest integer such that x + kz ≤ y.
The input contains multiple test cases. Each test case consists of three integers x, y, z separated by single spaces on a separate line. There are neither leading or trailing blanks nor empty lines. The input ends once EOF is met.
For each test case, output the value of __poj_jax_start__\bigoplus_{k=0}^{\lfloor(y-x)/z\rfloor}x+kz__poj_jax_end__ on a separate line. There should be neither leading or trailing spaces nor empty lines.
2 173 11
48
时间上限 | 内存上限 |
5000 | 131072 |