MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / solve

Function solve

CodeChef_problems/Chef and Street Food/solution.cpp:22–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20 return 0;
21}
22void solve()
23{
24 long long int typesOfFood, shops, price, people, max=0, temp;
25 cin>>typesOfFood;
26 for(int i=0;i<typesOfFood;i++)
27 {
28 cin>>shops>>people>>price;
29 temp = people/(shops+1)*price;//shops +1 because a new shop will be created by chef
30 if(temp>max)//Because we need to maximise profit
31 max=temp;
32 }
33 cout<<max<<"\n";
34}

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected