博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CodeForces 248B - Chilly Willy - 找规律
阅读量:2133 次
发布时间:2019-04-30

本文共 1201 字,大约阅读时间需要 4 分钟。

B. Chilly Willy
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Chilly Willy loves playing with numbers. He only knows prime numbers that are digits yet. These numbers are2, 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 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.

Examples
Input
1
Output
-1
Input
5
Output
10080
#include
#include
using namespace std;int main(){ int n; scanf("%d",&n); if(n<3) printf("-1\n");//此时没有答案 else if(n==3) printf("210\n");//容易算出210 else//后面的数根据规律来算 { printf("1"); int m=50; for(int i=0;i

转载地址:http://dpzgf.baihongyu.com/

你可能感兴趣的文章
flask_migrate
查看>>
解决activemq多消费者并发处理
查看>>
UDP连接和TCP连接的异同
查看>>
hibernate 时间段查询
查看>>
java操作cookie 实现两周内自动登录
查看>>
Tomcat 7优化前及优化后的性能对比
查看>>
Java Guava中的函数式编程讲解
查看>>
Eclipse Memory Analyzer 使用技巧
查看>>
tomcat连接超时
查看>>
谈谈编程思想
查看>>
iOS MapKit导航及地理转码辅助类
查看>>
检测iOS的网络可用性并打开网络设置
查看>>
简单封装FMDB操作sqlite的模板
查看>>
iOS开发中Instruments的用法
查看>>
iOS常用宏定义
查看>>
什么是ActiveRecord
查看>>
有道词典for mac在Mac OS X 10.9不能取词
查看>>
关于“团队建设”的反思
查看>>
利用jekyll在github中搭建博客
查看>>
Windows7中IIS简单安装与配置(详细图解)
查看>>