-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path11344.cpp
More file actions
43 lines (42 loc) · 944 Bytes
/
11344.cpp
File metadata and controls
43 lines (42 loc) · 944 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
42
43
/**
* ____
* ____ ___ ____ ________ __/ __/
* / __ `__ \/ __ `/ ___/ / / / /_
* / / / / / / /_/ / / / /_/ / __/
* /_/ /_/ /_/\__,_/_/ \__,_/_/
*
* @link : https://the-redback.com
*/
#include <bits/stdc++.h>
using namespace std;
#define inf HUGE_VAL
#define mem(a, b) memset(a, b, sizeof(a))
char a[100100];
int mod(int d) {
int rem, i;
rem = 0;
for (i = 0; a[i]; i++) {
rem = rem * 10 + a[i] - 48;
rem = rem % d;
}
return rem;
}
int main() {
int tc, t = 1;
int res, ret, i, j, k, n;
scanf("%d", &tc);
while (tc--) {
scanf("%s", &a);
scanf("%d", &n);
res = 0;
while (n--) {
scanf("%d", &k);
if (!res) res = mod(k);
}
if (res)
printf("%s - Simple.\n", a);
else
printf("%s - Wonderful.\n", a);
}
return 0;
}