# 【题解】第五届石家庄铁道大学程序设计竞赛热身赛题解 精

## A - 欢乐的a和b

```#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
int main(){
int T;
scanf("%d", &T);
while (T--){
long long a, b;
scanf("%lld%lld", &a, &b);
a %= mod;
b %= mod;
printf("%lld\n", (a * b) % mod);
}
return 0;
}```

## B - 欢乐的abc

```#include <iostream>
using namespace std;
int main(){
int t;
cin >> t;
for (int i = 1; i <= t; i++){
int a, b, c;
cin >> a >> b >> c;
if ((a + b > c) && (b + c > a) && (a + c > b))
cout << "YES" << endl;
else
cout << "NO" << endl;
}
return 0;
}```

## C - 欢乐贴砖块

```#include <iostream>
using namespace std;
int main() {
int T;
cin >> T;
while (T--) {
int n, m;
cin >> n >> m;
int k;
cin >> k;
if (n % 2 == 0 && m % 2 == 0) {
if (k % 2)
cout << "NO" << endl;
else
cout << "YES" << endl;
continue;
}
if (n % 2) {
k -= m / 2;
if (k % 2 || k < 0)
cout << "NO" << endl;
else
cout << "YES" << endl;
} else {
k = m * n / 2 - k;
k -= n / 2;
if (k % 2 || k < 0)
cout << "NO" << endl;
else
cout << "YES" << endl;
}
}
}```

# 近期热帖

• 回复(0) 发表于 2022-01-26 18:58:35
• 回复(0) 发表于 2022-01-26 11:25:53

# 等你来战

• 报名截止时间：2022-01-28 14:00
• 报名截止时间：2022-01-31 16:00
• 报名截止时间：2022-01-28 18:00
• 报名截止时间：2022-02-14 17:00

# 热门推荐

• 扫描二维码，关注牛客网

• 下载牛客APP，随时随地刷题