2 solutions

  • 0
    @ 2026-8-27 15:51:38
    #include<bits/stdc++.h>
    using namespace std;
    int A,B,l;
    double get(int a,int b){
    	return a*1.0/b;
    }
    int main(){
    	cin>>A>>B>>l;
    	int a=l,b=1;
    	for(int i=1;i<=l;i++){
    		for(int j=1;j<=l;j++){
    			if(get(i,j)>=get(A,B)&&get(a,b)>get(i,j))a=i,b=j;
    		}
    	}
    	cout<<a<<' '<<b;
    }
    

    Information

    ID
    462
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    6
    Tags
    # Submissions
    28
    Accepted
    11
    Uploaded By