## 834 - Continued Fractions

Moderator: Board moderators

nymo
Experienced poster
Posts: 149
Joined: Sun Jun 01, 2003 8:58 am
Location: :)

### numerator / denominator == a whole number ???

I get ACC even without considering the case when numerator / denominator is a whole number. My program crashes on this input. So, there may not be such a case.

plamplam
Experienced poster
Posts: 150
Joined: Fri May 06, 2011 11:37 am

### Re: 834 - Continued Fractions

I agree with nymo, I could modify my program to handle special cases where the numerator / denominator is a whole number but I decided to give it a shot first. AC in first try. My program would get Runtime Error if there were such cases. Very simple problem, you should get AC if the sample output matches as there are no special cases.
You tried your best and you failed miserably. The lesson is 'never try'. -Homer Simpson

uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

### Re: 834 - Continued Fractions

Timo wrote: I have create random sample input and output from my AC program.

These are some great test cases! Thanks for sharing.
Check input and AC output for over 7,500 problems on uDebug!

axelblaze
New poster
Posts: 34
Joined: Mon Jun 23, 2014 7:45 pm

### Re: 834 - Continued Fractions

Don't know why getting TLE...! Tested all the inputs by timo...
here's my code... plz help...

Code: Select all

``Got AC...``
Last edited by axelblaze on Fri Oct 10, 2014 1:31 pm, edited 1 time in total.

lighted
Guru
Posts: 585
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

### Re: 834 - Continued Fractions

It is more safe to read this way.

Code: Select all

``while (scanf("%d %d", &a, &b) == 2)``
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman

axelblaze
New poster
Posts: 34
Joined: Mon Jun 23, 2014 7:45 pm

### Re: 834 - Continued Fractions

Thanks I got AC...