atcoder#ARC129C. [ARC129C] Multiple of 7
[ARC129C] Multiple of 7
Score : points
Problem Statement
Given is an integer .
Find one string consisting of 1
, 2
, , 9
that satisfies the conditions below.
- The length of , , is at most .
- There are exactly pairs of integers () that satisfy the following condition.- When the -th through -th characters of are extracted and seen as a number, it is divisible by .
- When the -th through -th characters of are extracted and seen as a number, it is divisible by .
Under the Constraints of this problem, we can prove that a solution always exists.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print a string that satisfies the conditions. If multiple solutions exist, printing any of them would be accepted.
2
142
Two pairs satisfy the conditions.
3
77
Three pairs satisfy the conditions.