Back
Close
  • 2

Learning Opportunities

This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.

Statement

 Goal

Given a strictly positive integer n and the two non 0 digits a and b (one is odd, the other is even), find the positive integer that has n digits (using only a or b) and that is divisible by 2^n .

There is always a unique integer satisfying all the conditions (you can try to prove it as an exercise).
Input
Line 1: A strictly positive integer n.
Line 2: Two digits a and b separated by a space.
Output
Line 1: The number you found
Constraints
0<n≤500
0<a, b<10
a and b have different parity.
Example
Input
1
2 5
Output
2

A higher resolution is required to access the IDE