ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1011. Conductors

WA #17 ???
Posted by lasha peradze Free University 26 Jan 2012 20:31
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<cmath>

using namespace std;
int main(void) {
    long double p,q;
    cin>>p>>q;
    int n=1,m;
    int k1,k2;
    int i,j;
    if (p<q) {
        for (m=1; m<100000; m++){
            for (i=0; i<=100*m/q; i++){
                k1=i;
            }
            for (j=0; j<100*m/p; j++){
                k2=j;
            }

            if (k1+1<=k2){
                n=k1+1;
                break;
            }
        }
        cout<<n;
    }
    if (p==q){

    }
    //system("pause");

}