pastebin

Paste Search Dynamic
Recent pastes
min
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main() {
  4.   int n;
  5.   cin>>n;
  6.   for(int i=1;i<=4;i++){
  7.     int a,b,c,d;
  8.     cin>>a>>b>>c>>d;
  9.     if (min(a,b) + min(c,d)<=n){
  10.       cout<<i<<" "<<min(a,b)<<" "<<n - min(a,b);
  11.       return 0;
  12.     }
  13.   }
  14.   cout<<"-1";
  15.   return 0;
  16. }
Parsed in 0.004 seconds