1 solutions

  • 0
    @ 2026-10-18 10:30:13
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    
    	double a,b,c=10000000,s,x=2;
        cin>>a>>b>>s;
        if(a>s) cout<<1;
        else if(b>s) cout<<2;
        else{
            while(1){
            x++;
            c=sqrt(pow(a,2)+pow(b,2));
            if(c>s){
                cout<<x;
                return 0;
            }
            a=b;
            b=c;
            } 
        }
       
        
    	return 0;
    }
    
    • 1

    Information

    ID
    3588
    Time
    1000ms
    Memory
    512MiB
    Difficulty
    9
    Tags
    # Submissions
    12
    Accepted
    4
    Uploaded By