Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <cstdio>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. typedef     long long       LL;
  6.  
  7. int main()
  8. {
  9.     int t;
  10.     scanf("%d", &t);
  11.  
  12.     for(int tc = 1; tc <= t; ++tc) {
  13.         LL x, a, y, b;
  14.         scanf("%lld %lld %lld %lld", &x, &a, &y, &b);
  15.  
  16.         bool ans = (abs(a * log10(x) - b * log10(y)) < 1e-7);
  17.  
  18.         printf("Case %d: %s\n", tc, (ans? "Yes": "No"));
  19.     }
  20.  
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement