-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path565-cards-for-friends.cpp
More file actions
60 lines (59 loc) · 1.46 KB
/
Copy path565-cards-for-friends.cpp
File metadata and controls
60 lines (59 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* Cards for Friends [1472A]
* Problem: https://codeforces.com/problemset/problem/1472/A
* Verdict: ACCEPTED Solved: 2021-01-04
* Language: C++17 (GCC 7-32)
* Runtime: 31 ms Memory: 0 KB
* Tags: greedy, math
* Author: BidoTeima
* Source: https://codeforces.com/contest/1472/submission/103199157
*/
#include <bits/stdc++.h>
using namespace std;
// Important functions and defines
#define f first
#define s second
#define int long long
int POW(int a, int b) {
int res = 1;
while(b > 0) {
if(b%2==1) res*=a;
a*=a;
b/=2;
}
return res;
}
int sum_range2d(int i, int j, int k, int l, vector<vector<int>>& sum) {
return sum[k][l] - sum[k][j - 1] - sum[i - 1][l] + sum[i - 1][j - 1];
}
int gcd(int a, int b) {
return (b == 0 ? abs(a) : gcd(b, a % b));
}
int dist(int X1, int Y1, int X2, int Y2) {
return sqrt( POW(X1-X2, 2) + POW(Y1-Y2,2) );
}
bool intersect(pair<int, int> p1, pair<int, int> p2) {
int x1 = p1.first, x2 = p1.second, y1 = p2.first, y2 = p2.second;
return (x1 >= y1 && x1 <= y2) ||
(x2 >= y1 && x2 <= y2) ||
(y1 >= x1 && y1 <= x2) ||
(y2 >= x1 && y2 <= x2);
}
// End
int32_t main()
{
ios::sync_with_stdio(0);
cout.tie(0);
cin.tie(0);
int t;
cin>>t;
while(t--) {
int w, h, n;
cin>>w>>h>>n;
int ans = 1;
while(w%2==0) ans*=2, w/=2;
while(h%2==0) ans*=2, h/=2;
cout<<(ans>=n?"YES\n":"NO\n");
}
return 0;
}