CodeForces - 1669A Division?

Codeforces separates its users into 44 divisions by their rating:

For Division 1: 1900 \leq \mathrm{rating}1900≤rating
For Division 2: 1600 \leq \mathrm{rating} \leq 18991600≤rating≤1899
For Division 3: 1400 \leq \mathrm{rating} \leq 15991400≤rating≤1599
For Division 4: \mathrm{rating} \leq 1399rating≤1399
Given a \mathrm{rating}rating, print in which division the \mathrm{rating}rating belongs.

Input
The first line of the input contains an integer tt (1 \leq t \leq 10^41≤t≤10
4
) — the number of testcases.

The description of each test consists of one line containing one integer \mathrm{rating}rating (-5000 \leq \mathrm{rating} \leq 5000−5000≤rating≤5000).

Output
For each test case, output a single line containing the correct division in the format “Division X”, where XX is an integer between 11 and 44 representing the division for the corresponding rating.

Sample 1
Inputcopy Outputcopy
7
-789
1299
1300
1399
1400
1679
2300
Division 4
Division 4
Division 4
Division 4
Division 3
Division 2
Division 1
Note
For test cases 1-41−4, the corresponding ratings are -789−789, 12991299, 13001300, 13991399, so all of them are in division 44.

For the fifth test case, the corresponding rating is 14001400, so it is in division 33.

For the sixth test case, the corresponding rating is 16791679, so it is in division 22.

For the seventh test case, the corresponding rating is 23002300, so it is in division 11.

#include<iostream>
using namespace std;
int main(void) {
	int n;
	cin >> n;
	int m;
	for (int i = 0; i < n; i++) {
		cin >> m;
		if (m < 1400) {
			cout << "Division 4" << endl;
		}
		else {
			if (m < 1600) {
				cout << "Division 3" << endl;
			}
			else {
				if (m < 1900) {
					cout << "Division 2" << endl;
				}
				else {
					cout << "Division 1" << endl;
				}
			}
		}
	}
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值