Fork Copy #include using namespace std; int T, tc; int n, p[30]; int profit; int findNextMax(int index){ int max=index; for (;indexp[max]){ max=index; } } return max; } int main(){ freopen("StockExchange.txt","r",stdin); cin>>T; for (tc=1;tc<=T;tc++){ cin>>n; for (int i=0;i>p[i]; int i=0; profit=0; while(i