-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcardsforfriends.java
More file actions
33 lines (29 loc) · 794 Bytes
/
cardsforfriends.java
File metadata and controls
33 lines (29 loc) · 794 Bytes
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
import java.util.Scanner;
/**
* <a href="https://codeforces.com/contest/1472/problem/A"></a>
*/
public class cardsforfriends {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-- >= 1) {
int w = sc.nextInt();
int h = sc.nextInt();
long n = sc.nextLong();
long sheets = 1;
while (w % 2 == 0) {
w = w / 2;
sheets = sheets * 2;
}
while (h % 2 == 0) {
h = h/2;
sheets = sheets*2;
}
if(sheets>=n){
System.out.println("YES");
}else{
System.out.println("NO");
}
}
}
}