#Z14411. 不定方程求解

不定方程求解

Description

Given positive integers a, b, c, find the number of all non-negative integer solution pairs (x, y) for the indeterminate equation ax + by = c.

Input Format

A single line containing three positive integers a, b, c, separated by single spaces. Each number is no greater than 1000.

Output Format

An integer representing the number of non-negative integer solutions to the indeterminate equation.

2 3 18

4