;
}
long Pow_Mod(long x, long y, long mod) {
long ans = 1;
while (y > 0) {
if ((y & 1) > 0)
ans *= x;
ans %= mod;
y >>= 1;
x = x * x;
x %= mod;
}
return ans;
}
int gcd(int x, int y){
if(x>y){int tmp = x; x = y; y = tmp;}
while(x>0){
y %= x;
int tmp = x; x = y; y = tmp;
}
return y;
}
int max(int x, int y) {
return x > y ? x : y;
}
int min(int x, int y) {
return x < y ? x : y;
}
double max(double x, double y) {
return x > y ? x : y;
}
double min(double x, double y) {
return x < y ? x : y;
}
long max(long x, long y) {
return x > y ? x : y;
}
long min(long x, long y) {
return x < y ? x : y;
}
int abs(int x) {
return x > 0 ? x : -x;
}
double abs(double x) {
return x > 0 ? x : -x;
}
long abs(long x) {
return x > 0 ? x : -x;
}
boolean zero(double x) {
return abs(x) < eps;
}
double sin(double x){return Math.sin(x);}
double cos(double x){return Math.cos(x);}
double tan(double x){return Math.tan(x);}
double sqrt(double x){return Math.sqrt(x);}
}
|