ca01 - of output followed by an integer N which indicates...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
In the Name of God Fall 2005 Discrete Mathematics Computer Assignment 1 Due: Azar 1 Given the values of three integers m, n, p , how many integer solutions does the following equation have? m x + n y = 1 p Input The input Fle contains at most 1001 sets of inputs. Each set of input is given in a single line containing three non-zero integers which denote the values of m, n and p respectively. Input is terminated by a case where the values of m, n and p ( - 1000 m, n, p 1000) are zero. Output ±or each set of input produce one line of output which contains the serial
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: of output followed by an integer N which indicates how many solutions are there for the given values of m, n and p. Sample Input 1 2 4 2 3 4 0 0 0 Output for Sample Input Case 1: 11 Case 2: 23 Comment The equation corresponding to the frst sample input is: 1 x + 2 y = 1 4 and the 11 solutions corresponding to this equation are:-28 7 1-12 6-4 4 2 -8 3 -24 5 40 6 24 8 16 12 12 20 10 36 9 2...
View Full Document

This note was uploaded on 02/06/2011 for the course ECE 423 taught by Professor Dolatabadi during the Spring '11 term at Amirkabir University of Technology.

Page1 / 2

ca01 - of output followed by an integer N which indicates...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online