#include <stdio.h>#include <math.h>int
main() {
int t, a, b, c, d;
double e, f;
scanf("%d", &t);
while( t-- ) {
scanf("%d%d%d%d", &a, &b, &c, &d);
e = b * log(a);
f = d * log(c);
if( e < f ) {
printf("<\n");
}
else {
printf(">\n");
}
}
return0;
}
/*
反省:
下面是我开始的代码,因为指数太大,我开始的想法是取余然后比较大小,真的是傻。
举个例子:8 mod 5 == 8 * 6 mod 5,很容易就误判了。
*/#include <stdio.h>#define mod 1000000000int// 幂取模
pow_mod(int a, int n, int m) {
if( n == 0 ) {
return1;
}
int x = pow_mod(a, n / 2, m);
longlong ans = (longlong)x * x % m;
if( n % 2 == 1 ) {
ans = ans * a % m;
}
return (int)ans;
}
int
main() {
int t, a, b, c, d, e, f;
scanf("%d", &t);
while( t-- ) {
scanf("%d %d %d %d", &a, &b, &c, &d);
e = pow_mod(a, b, mod);
f = pow_mod(c, d, mod);
if( e < f ) {
printf("<\n");
}
else {
printf(">\n");
}
}
return0;
}