21977_Hote

2022-5-16 18:20| 发布者: Hocassian| 查看: 29| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-8950610230499-Problem List-采集的数据-后羿采集器.html

Pro.ID

21977

Title

Hotel

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21977

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 400/200 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others)
  • 描述

    A new hotel has been built in a city where the citizens believe that the number 13 brings bad luck. The hotel has n rooms which are numbered from 1 to n inclusive. One of the main properties of a room is its unlucky value which depends on the room number. Only number whose decimal forms contain the substring "13" will be considered to be unlucky numbers. For example, 13, 132, 1313, 9130 are unlucky numbers, but 1, 3, 31, 103, 123123 are not. The unlucky value of a room is the square of the room number if the room number is unlucky, and zero otherwise.

    A hotel's unlucky value equals the sum of the unlucky value of all its rooms. Help the manager to calculate the unlucky value of this hotel.

    输入

    The first line contains an integer T ( T ≤ 100 ) indicating the number of test cases. T lines follows, each line contains an integer k ( 1 ≤ k ≤ 100 ) indicating that this hotel has 10k ( the k-th power of 10 ) rooms.

    输出

    Description

    A new hotel has been built in a city where the citizens believe that the number 13 brings bad luck. The hotel has n rooms which are numbered from 1 to n inclusive. One of the main properties of a room is its unlucky value which depends on the room number. Only number whose decimal forms contain the substring "13" will be considered to be unlucky numbers. For example, 13, 132, 1313, 9130 are unlucky numbers, but 1, 3, 31, 103, 123123 are not. The unlucky value of a room is the square of the room number if the room number is unlucky, and zero otherwise.

    A hotel's unlucky value equals the sum of the unlucky value of all its rooms. Help the manager to calculate the unlucky value of this hotel.

    Input

    The first line contains an integer T ( T ≤ 100 ) indicating the number of test cases. T lines follows, each line contains an integer k ( 1 ≤ k ≤ 100 ) indicating that this hotel has 10k ( the k-th power of 10 ) rooms.

    Output

    For each test case, print the case number and the answer % 100003 in a single line where the answer is the unlucky value of this hotel. Follow the format of the sample output please.

    Sample Input

    3
    1
    2
    3

    Sample Output

    Case 1: 0
    Case 2: 169
    Case 3: 49582

    Source

    样例输入

    3
    1
    2
    3

    样例输出

    Case 1: 0
    Case 2: 169
    Case 3: 49582

    提示

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部