Description
“队长,我想进集训队!”这是小A内心的愿望,然而进集训队是有一定要求的,小A现在只知道自己的情况,请你帮他/她判断一下是否可以进入集训队。
已知进入集训队的条件如下:
以下所有成绩累加,男生达到 90 分,女生达到 60 分。
(1) COJ
入门题 | 1分/题 |
基础题 | 2分/题 |
进阶题 | 5分/题 |
(2)2015年度中南大学第九届大学生程序设计竞赛
一等奖 | 20分 |
二等奖 | 10分 |
三等奖 | 5分 |
(3)选拔赛(共两场,取加分较高者)
名次前15%,四舍五入 | 20分 |
名次前30%,四舍五入 | 10分 |
名次前45%,四舍五入 | 5分 |
请你根据小A的条件,判断能不能小A能不能如愿进入集训队。
Input
多组数据,第一行有一个整数T,表示有T组数据。(T<=100)
以下每组数据第一行有一个字母s,s为“m”表示小A为男性,s为“f”则为女性。
第二行有五个整数X1,X2,X3,N和M。X1、X2、X3依次分别表示小A完成的入门题、基础题和进阶题的数量,N和M表示小A在两场比赛中获得的加分。(0<=X1、X2、X3<=30,0<=N、M<=20)
Output
每组数据单独一行。如果小A能进入集训队,输出“Welcome”,如果不能,输出小A离达到标准还需要的分数。
Sample Input
2 m 10 10 9 5 5 f 15 10 3 5 5
Sample Output
5 Welcome水题#include<cstdio> #include<cstring> #include<iostream> #include<queue> #include<vector> #include<map> #include<cmath> #include<algorithm> using namespace std; const int maxn = 100005; int T, n, m, x1, x2, x3, tot; char s[10]; int main() { while (cin >> T) { while (T--) { scanf("%s%d%d%d%d%d", s, &x1, &x2, &x3, &n, &m); tot = x1 + 2 * x2 + 5 * x3 + n + m; if (s[0] == 'm') { if (tot >= 90) printf("Welcome\n"); else printf("%d\n", 90 - tot); } else { if (tot >= 60) printf("Welcome\n"); else printf("%d\n", 60 - tot); } } } return 0; }