Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
643 B
2
Indexable
Never
#include <iostream>

using namespace std;
struct anNastere
{
    int an, luna, zi; 
};
anNastere V[1005];
int main()
{
 int n, p, q;
 cin>>n;
 for(int i=0; i<n; i++)
 {
     cin>>V[i].an>>V[i].luna>>V[i].zi;
 }
 p=0;
 q=0;
 for(int i=1; i<n; i++)
 {
     if(V[i].an>V[p].an || V[i].an==V[p].an && V[i].luna>V[p].luna || V[i].an==V[p].an && V[i].luna==V[p].luna && V[i].zi>V[p].zi)
     {
         p=i;
     }
     if(V[i].an<V[q].an || V[i].an==V[q].an && V[i].luna<V[q].luna || V[i].an==V[q].an && V[i].luna==V[q].luna && V[i].zi<V[q].zi)
     {
         q=i;
     }
 }
 cout<<p+1<<" "<<q+1;

    return 0;
}