248B.md (1029B)
1 Source: https://codeforces.com/problemset/problem/248/B 2 3 B. Chilly Willy 4 5 time limit per test 6 7 2 seconds 8 9 memory limit per test 10 11 256 megabytes 12 13 input 14 15 stdin 16 17 output 18 19 stdout 20 21 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. 22 23 Chilly Willy wants to find the minimum number of length *n*, such that it is simultaneously divisible by all numbers Willy already knows (2, 3, 5 and 7). Help him with that. 24 25 A number's length is the number of digits in its decimal representation without leading zeros. 26 27 Input 28 29 A single input line contains a single integer *n* (1 ≤ *n* ≤ 105). 30 31 Output 32 33 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. 34 35 Examples 36 37 Input 38 39 ``` 40 1 41 ``` 42 43 Output 44 45 ``` 46 -1 47 ``` 48 49 Input 50 51 ``` 52 5 53 ``` 54 55 Output 56 57 ``` 58 10080 59 ```