You are viewing a single comment's thread. Return to all comments →
int a,b,c,d; BigInteger ans; // for x axis if(x1>x2){ a=x2; b=x1; }else{ a=x1; b=x2; } // for y axis if(y1>y2){ c=y2; d=y1; }else{ c=y1; d=y2; } // difference BigInteger x=new BigInteger(String.valueOf(b-a)); BigInteger y=new BigInteger(String.valueOf(d-c)); // gcd calculation ans=x.gcd(y); int i= ans.intValue(); return i-1;
Seems like cookies are disabled on this browser, please enable them to open this website
Sumar and the Floating Rocks
You are viewing a single comment's thread. Return to all comments →