Description線分上のグリッドポイントの数 と を結ぶ線分が与えられたとき、この線分が通過するグリッドポイント(整数座標をもつ点)の数を求める問題です。グリッドポイントを数える際には、答えから を除いてください。入力入力は 1 行で、2 つの整数 x と y (1 ≤ x, y ≤ ) が与えられます。出力線分が通過するグリッドポイントの数を出力してください。例入力出力8 12412 84ConstraintsTime limit: 1.6 secondsMemory limit: 512 MBOutput limit: 1 MBTo check your solution you need to sign inSign in to continueSign in to your accountSign in with GoogleSign in with FacebookSign in with MicrosoftSign in with emailBy continuing, you agree to our Terms of Service and Privacy Policy.