Advertisement
yuawn

algo2017_week9_Crane_Origami

Nov 29th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define pb push_back
  4. #define INF 1e9
  5. #define fo(n) for(int i=0;i<n;i++)
  6. #define fos(o,n) for(int i=o;i<=n;i++)
  7.  
  8. int main(){
  9.    
  10.     int n;
  11.    
  12.     while( cin >> n ){
  13.        
  14.         if( n == 0 ) break;
  15.        
  16.         int ans , w , h , now = -1;
  17.    
  18.         fo( n ){
  19.            
  20.             int l , r = 4;
  21.            
  22.             cin >> w >> h;
  23.            
  24.             l = min( w , h );
  25.            
  26.             //while( max( w , h ) / l < r && r ) l /= 2 , r /= 2;
  27.            
  28.             if( l > now ) ans = i + 1 , now = l;
  29.         }
  30.        
  31.         cout << ans << endl;
  32.        
  33.     }
  34.    
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement