1 solutions

  • 0
    @ 2025-11-5 20:15:18

    C++ :

    #include <iostream>
    using namespace std;
    unsigned int func(long long x,long long y,long long z){
    	for(long long  i=1;i<=z*2;i++){
    		if(y<=0)
    			return 0;
    		if(i%2==1)
    			y -= x; 			
    		if(i%4 == 0)
    			y *= 2;
    		if(i%6 == 0)
    			x *= 2; 	
    	}
    	return y;		
    }
    int main(){
    	for(long long x,y,z;cin>>x>>y>>z;)
    		cout<<func(x,y,z)<<endl; 
    	return 0;
    }
    
    • 1

    Information

    ID
    20186
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By