Logo
(追記) (追記ここまで)

6210번 - Wonderprime Brands 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB401716220.130%

문제

The cows are forever competing to see who has the best brand. The latest rage is brands that are 'Wonderprimes'. You probably already know that a brand consists of a sequence of digits that does not begin with 0; brands actually look a lot like positive integers.

A wonderprime is a number that can be partitioned into two prime numbers, each of which has at least D digits and, of course, doesn't start with 0. When D=2, the number 11329 is a wonderprime (since it connects 113 and 29, both of which are prime).

Only a few of the cows have wonderprime brands, but they all want one. Your job is to find the first wonderprime greater than or equal to a supplied integer N (1 <= N <= 2,000,000,000). No integer greater than 2,000,000,000 will be required.

입력

  • Line 1: Two space-separated integers: D and N

출력

  • Line 1: A line that contains the first wonderprime no smaller than N.

제한

예제 입력 1

2 11328

예제 출력 1

11329

힌트

출처

Olympiad > USA Computing Olympiad > 2006-2007 Season > USACO December 2006 Contest > Bronze 1번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /