Professional Documents
Culture Documents
Dec 16
Dec 16
Given three positive integers x, y and n, the task is to find count of all numbers
from 1 to n that can be formed using x and y. A number can be formed using x and
y if we can get it by adding any number of occurrences of x and/or y. Write a C
program using function to solve this problem.
Input format:
Output format:
Print the count of all numbers between 1 and n which can be formed using x and y
in a new line.
Example:
Input:
2 3 10
Output:
Explanation:
Input : x = 2, y = 3, n = 10
Output : 9