Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. #include <vector>
  4. #include "algorithm"
  5.  
  6. int gcd (int a, int b) {
  7.     return b ? gcd (b, a % b) : a;
  8. }
  9.  
  10. bool f(const int mas[3], const int mas1[3]){
  11.   return mas[0] < mas1[0];
  12. }
  13.  
  14. int main() {
  15.   int t; cin >> t;
  16.   int mas[1000][3], mas2[1000][3];
  17.   for (int i = 0; i < t; i++)
  18.   {
  19.     int n; cin >> n;
  20.    
  21.     int summ1 = 0;
  22.     int summ2 = 0;
  23.     int summ3 = 0;
  24.     int maxx = 0;
  25.     for (int j = 0; j < n; i++){
  26.       cin >> mas[j][0] >> mas[j][1];
  27.     }
  28.     sort(mas, mas+n, f);
  29.   }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement