#include #include #include #include #include int main(void) { int member,kind; int price[10001]={0}; int karasa[10001]={0}; int mentaip[1001]={0}; int mentaik[1001]={0}; scanf("%d",&member); for(int i=0;i=karasa[j]&&mentaip[i]<=price[j]) { buycnt[i]++; } } } int max=0,buy=0; for(int i=0;imax) { kiseki[0]=i+1; max=buycnt[i]; buy=1; } else if (buycnt[i]==max) { kiseki[buy]=i+1; buy++; } else { buy=0; } } int i=0; while(kiseki[i]!=0) { printf("%d\n",kiseki[i]); } }