#include #include #include #include unsigned long long int * costs,*effectivecosts; int * status; int end=0, n=0,k=0;; //calculate effectivity void effectivity(){ end=1; int i=0; for(i=0;i=n) h=n-1; for(g;g<=h;g++){ if(status[g]==1) { end=0; effectivecosts[i]+=costs[g]; } } } } int getMax() { int max=effectivecosts[0],i=0,pivot=0; for(i=0;i=n) h=n-1; for(g;g<=h;g++) status[g]=0; } printf("%llu",tcosts); /* Enter your code here. Read input from STDIN. Print output to STDOUT */ return 0; }