#707. number game 2

number game 2

当前没有测试数据。

Background

Special for beginners, ^_^

Description

给定 x,y,z,wx,y,z,w>z>z 的最小 kk 使得 gcd(x+k,y+k)<w\gcd(x+k,y+k)<w

多次询问

x,y,z,w109x,y,z,w\le 10^9

Format

Input

Two integers x and y, satisfying 0x,y327670\leq x,y\leq 32767 .

Output

One integer, the sum of x and y.

Samples

123 500
623

Limitation

1s, 1024KiB for each test case.