Problem link:
11044 - Searching for Nessy
Solution:
11044 - Searching for Nessy
Solution:
- #include <bits/stdc++.h>
- using namespace std;
- typedef long long LL;
- const int S = 300003;
- const int MOD = 1e9+7;
- const double pi = 2 * acos (0.0);
- int _I(){int x; scanf("%d", &x); return x;}
- LL _LL(){LL x; scanf("%lld", &x); return x;}
- int dirX[]={1, 0, -1, 0, 1, -1, 1, -1};
- int dirY[]={0, 1, 0, -1, 1, -1, -1, 1};
- int rX[] = {1, 1, 2, 2, -1, -1, -2, -2};
- int rY[] = {2, -2, 1, -1, 2, -2, 1, -1};
- template <class T> T Distance(T x1, T y1, T x2, T y2){return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));};
- int sset(int N, int pos){return N=N|(1<<pos);}
- bool check(int N, int pos){return (bool)(N&(1<<pos));}
- int reset(int N, int pos){return N=N&~(1<<pos);}
- ///...............Code Starts From Here...............///
- int main(){
- int t = _I();
- while(t--){
- int n = _I(), m = _I();
- n /= 3;
- m /= 3;
- n *= m;
- printf("%d\n", n);
- }
- return 0;
- }
No comments:
Post a Comment