Cod sursa(job #2556365)

Utilizator radugheoRadu Mihai Gheorghe radugheo Data 24 februarie 2020 20:44:56
Problema Pachete Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.79 kb
#include <bits/stdc++.h>
using namespace std;

ifstream fin  ("pachete.in");
ofstream fout ("pachete.out");

int n, sx, sy, i, x, y, j, k, xx, yy, solx, soly, cadran1, cadran2, cadran3, cadran4, a, b, c, d, e, f, g, h, p, maxim;

int cadrane[5];

int main(){
    fin >> n >> sx >> sy;
    for (i=1; i<=n; i++){
        fin >> x >> y;
        x -= sx, y -= sy;
        if (x < 0){
            cadrane[1]++;
        }
        if (y < 0){
            cadrane[2]++;
        }
        if (x > 0){
            cadrane[3]++;
        }
        if (y > 0){
            cadrane[4]++;
        }
    }
    for (i=1; i<=4; i++){
        if (cadrane[i] > maxim){
            maxim = cadrane[i];
            p = i;
        }
    }
    fout << maxim - 1 << "\n";
    return 0;
}
//incercare