Description
Solution
模拟
Code
const int maxn = 1e2 + 7;
int a[maxn];
int main() {
int T;scanf("%d",&T);
for(int cas = 1;cas <= T;++cas) {
int n,m;scanf("%d %d",&m,&n);
ll sum = 0;
for(int i = 1;i <= n;++i) {
scanf("%d",&a[i]); sum += a[i];
}
bool flag1 = false, flag2 = false;
if(sum == m) flag1 = true;
for(int i = 1;i < n;++i) {
if(a[i+1] - a[i] == 1) {flag2 = true; break;}
}
printf("Case %d: Thank You BACS!!!", cas);
if(flag1) printf(" Thik ache."); else printf(" Bojjat dokandar!!");
if(flag2) printf(" Yes\n"); else printf(" No\n");
}
}