#P9427. [蓝桥杯 2023 国 B] 拼数字

[蓝桥杯 2023 国 B] 拼数字

Problem Description

Xiao Lan wants to use NN digits 22 and MM digits 33 to form an integer with N+MN + M digits. Please compute the largest multiple of 20232023 that Xiao Lan can form.

Input Format

Two integers NN and MM.

Output Format

An integer with N+MN + M digits, representing the answer. If it is impossible to form a multiple of 20232023, output 1-1.

2 8
2233333333

Hint

Constraints

  • For 20%20\% of the testdata, 1N,M121 \le N, M \le 12.
  • For 40%40\% of the testdata, 1N,M1001 \le N, M \le 100.
  • For 60%60\% of the testdata, 1N,M100001 \le N, M \le 10000.
  • For 100%100\% of the testdata, 1N,M10000001 \le N, M \le 1000000.

Final Round of the 14th Lanqiao Cup Software Contest, C/C++ College Group B, Problem I.

Translated by ChatGPT 5