Skip to main content

Zomato

Zomato OA 2022 - Number Formation


Given three integers x, y, and z, the task is to find the sum of all the numbers formed by having the digit 4 at most x times, the digit 5 at most y times, and the digit 6 at most z times as a digit.

Note: Output the sum modulo (10^9 + 7).

Input Format:

  • Three integers X, Y, and Z.

Output Format:

  • A single integer representing the sum of all the numbers formed.

Constraints:

  • (0 <= X, Y, Z <= 60)

Example 1:

Input:

X = 1, Y = 1, Z = 1

Output:

3675

Explanation:

4 + 5 + 6 + 45 + 54 + 56 + 65 + 46 + 64 + 456 + 465 + 546 + 564 + 645 + 654 = 3675

Example 2:

Input:

X = 0, Y = 0, Z = 0

Output:

0

Explanation:

No number can be formed.