技术经验分享:CQUOJ9766ChillyWilly

简介: 技术经验分享:CQUOJ9766ChillyWilly

"

Chilly Willy loves playing with numbers. He only knows prime numbers that are digits yet. These numbers are 2, 3, 5 and 7. But Willy grew rather bored of such numbers, so he came up with a few games that were connected with them.

Chilly Willy wants to find the minimum number of length n, such //代码效果参考:https://v.youku.com/v_show/id_XNjQwMDQxOTYzNg==.html

that it is simultaneously divisible by all numbers Willy already knows (2, 3, 5 and 7). Help him with that.

A number's length is the number of digits in its decimal representation without leading zeros.

Input

A single input line contains a single integer n (1?≤?n?≤?105).

Output

Print a single integer — the answer to the problem without leading zeroes, or ""-1"" (without the quotes), if the number that meet the problem condition does not exist.

Sample Input

Input

1

Output

-1

Input

5

Output

10080

1 /*

2 2016年4月24日16:55:26

3 题意: 给定n 找到十进制数 长度为n的 能同时整除2 3 5 7的最小的数

4

5 要找到210的倍数 很明显只用考虑后三位 最后一位一定为0,

6 因此找规律可以得到6个数一个循环

7 ""05"", ""08"", ""17"", ""02"", ""20"", ""11""

8

9 明显个鬼啊

10 */

11

12

13

14 # include

15 # include

16 # include

17 # include

18 # include

19 # include

20 # include

21 # define LL long long

22 # define INF 0x3f3f3f3f

23 using namespace std;

24 const int N = 1e5 + 5;

2//代码效果参考:https://v.youku.com/v_show/id_XNjQwMDQxOTY3Ng==.html

5

26 char s【6】【3】 = {""05"", ""08"", ""17"", ""02"", ""20"", ""11""};

27

28 int main(void)

29 {

30 int n, tmp, i;

31 while (~scanf(""%d"", &n)){

32 if (n <= 2)

33 printf(""-1\n"");

34 else if (n == 3)

35 printf(""210\n"");

36 else {

37 printf(""1"");

38 for (i = 2; i <= n-3; i++)

39 printf(""0"");

40 tmp = (n - 4) % 6;

41 printf(""%s0\n"", s【tmp】);

42 }

43 }

44

45 return 0;

46 }


"
image.png
相关文章
|
1天前
|
Web App开发 人工智能 Java
技术经验分享:affineCipherandafineHacker
技术经验分享:affineCipherandafineHacker
10 2
|
2天前
技术经验分享:comparisonmethodviolates必现
技术经验分享:comparisonmethodviolates必现
技术经验分享:comparisonmethodviolates必现
|
1天前
|
应用服务中间件 PHP nginx
技术经验分享:fastcgimain
技术经验分享:fastcgimain
|
1天前
|
存储 缓存 NoSQL
技术经验分享:braum的使用
技术经验分享:braum的使用
|
2天前
|
JavaScript
技术经验分享:javascriptvar的理解
技术经验分享:javascriptvar的理解
|
2天前
|
C++
技术经验分享:C++程序设计的技巧
技术经验分享:C++程序设计的技巧
|
2天前
技术经验分享:HLG1314火影忍者之~纲手
技术经验分享:HLG1314火影忍者之~纲手
|
2天前
技术经验分享:Jacobi
程序技术好文:爬取梨视频网站详细过程
|
2天前
|
前端开发 JavaScript 容器
技术经验分享:CSSFIXEDpornjavhd
技术经验分享:CSSFIXEDpornjavhd
|
1天前
|
存储 C# 索引
技术经验分享:C#入门详解(8)
技术经验分享:C#入门详解(8)