-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmay99_3.cpp
More file actions
41 lines (39 loc) · 710 Bytes
/
may99_3.cpp
File metadata and controls
41 lines (39 loc) · 710 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
34
35
36
37
38
39
40
41
#include <iostream>
#include <cstring> //memset
#include <algorithm>
#include <bitset>
#include <string>
#include <vector>
#include <utility>
#include <cstdio>
#include <queue>
#include <cmath>
#include <list>
#include <set>
#include <map>
using namespace std;
int main() {
freopen("input.txt", "r", stdin);
int test_cases, x, y, z;
cin >> test_cases;
while (test_cases--) {
cin >> x >> y >> z;
if (z == 0)
cout << "YES" << endl;
else {
if (z > max(x, y)) {
if (z % (x+y) == 0)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
else {
if ((max(x, y) + z) % min(x, y) == 0)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
}
}
return 0;
}