1148 -- 小光棍数

来源:互联网 发布:手游推广联盟源码 编辑:程序博客网 时间:2024/05/15 08:33

小光棍数

Time Limit:1000MS  Memory Limit:65536K
Total Submit:205 Accepted:99

Description

最近Topcoder的XD遇到了一个难题,倘若一个数的三次方的后三位是111,他把这样的数称为小光棍数。他已经知道了第一个小光棍数是471,471的三次方是104487111,现在他想知道第m(m<=10000000000)个小光棍数是多少?

Input

有多组测试数据。第一行一个整数n,表示有n组测试数据。接下来的每行有一个整数m。

Output

输出第m个小光棍数。

Sample Input

11

Sample Output

471

Source

    using System;    using System.Collections.Generic;    using System.Linq;    using System.Text;    namespace AK1148 {        class Program {            static void Main(string[] args) {                int n = int.Parse(Console.ReadLine());                while (n-- > 0) {                    long x = long.Parse(Console.ReadLine());                    Console.WriteLine("{0}471", x - 1);                }            }        }    }


0 0
原创粉丝点击