Make it Divisible solution codechef

Make it Divisible solution codechef

Given an integer NN, help Chef in finding an NN-digit odd positive integerodd positive integer XX such that XX is divisible by 33 but not by 99.

Note:Note: There should not be any leading zeroes in XX. In other words, 003003 is not a valid 33-digit odd positive integer.

Make it Divisible solution codechef

  • The first line of input contains a single integer TT, denoting the number of testcases. The description of the TT testcases follows.
  • The first and only line of each test case contains a single integer NN, denoting the number of digits in XX.

Make it Divisible solution codechef

For each testcase, output a single line containing an NN-digit odd positive integer XX in decimal number system, such that XX is divisible by 33 but not by 99.

Constraints

  • 1T5001≤T≤500
  • 1N1041≤N≤104
  • The sum of NN over all test cases does not exceed 105105

Make it Divisible solution codechef

 

3
1
2
3

Make it Divisible solution codechef

 

3
15
123

Explanation

Test Case 11: 33 is the only 11-digit odd positive integer which is divisible by 33 but not by 99.

Test Case 22: 1515 is a 22-digit odd positive integer which is divisible by 33 but not by 992121 is also a valid answer, among others. Note that 0303 is not a valid answer as there should not be any leading zeroes in the output.

Leave a Comment