#abc326b. B - 326-like Numbers

B - 326-like Numbers

Score : 200200 points

问题陈述

326类数字是指一个三位正整数,其中百位数与十位数的乘积等于个位数。

例如,326,400,144326, 400, 144 是326类数字,而 623,777,429623, 777, 429 不是。

给定一个整数 NN,找出大于或等于 NN 的最小的326类数字。在给定的约束条件下,该数字总是存在的。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

A 326-like number is a three-digit positive integer where the product of the hundreds and tens digits equals the ones digit.

For example, 326,400,144326,400,144 are 326-like numbers, while 623,777,429623,777,429 are not.

Given an integer NN, find the smallest 326-like number greater than or equal to NN. It always exists under the constraints.

Constraints

  • 100N919100 \leq N \leq 919
  • NN is an integer.

Input

The input is given from Standard Input in the following format:

NN

Output

Print the answer.

Sample Input 1

320

Sample Output 1

326

320,321,322,323,324,325320,321,322,323,324,325 are not 326-like numbers, while 326326 is a 326-like number.

Sample Input 2

144

Sample Output 2

144

144144 is a 326-like number.

Sample Input 3

516

Sample Output 3

600

update @ 2024/3/10 01:49:03

}