CF1297A.Likes Display

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

The first line contains an integer tt ( 1t10001 \le t \le 1000 ) — the number of test cases in the input. The following are descriptions of the tt input test cases, one per line.

The description of each test case consists of a single line that contains a non-negative integer nn ( 0n21090 \le n \le 2\cdot10^9 ) — the number of likes.

输入格式

Print tt answers to the given test cases in the order from the input. Each printed value must have one of the following types:

  • either an integer from 0 to 999 which corresponds just to the number of likes,
  • or a number of thousands from 1K to 999K,
  • or a number of millions from 1M to 2000M.

The answer is equal to a view which is the closest (by difference) to the given number nn . If this rounding is ambiguous, then round answer up (to a greater value).

输出格式

Let's describe some test cases:

  • 17821782 can be displayed either as 1K or as 2K but 2K is the nearest view;
  • 15001500 have same difference with 1K and 2K so it should be rounded up;
  • 999999999999 should be displayed as 1M since it's closer to it than to 999K.

输入输出样例

  • 输入#1

    9
    999
    123
    0
    1782
    31415926
    1500
    999999
    35499710
    2000000000

    输出#1

    999
    123
    0
    2K
    31M
    2K
    1M
    35M
    2000M

说明/提示

Let's describe some test cases:

  • 17821782 can be displayed either as 1K or as 2K but 2K is the nearest view;
  • 15001500 have same difference with 1K and 2K so it should be rounded up;
  • 999999999999 should be displayed as 1M since it's closer to it than to 999K.
首页