Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int x,y[50],i,sum=0,count=0;
- scanf("%d",&x);
- for(i=0;i<=x-1;i++)
- {
- scanf("%d",&y[i]);
- sum += y[i];
- }
- for(i=0;i<=x-2;i++)
- {
- int j,temp=0;
- for(j=0;j<=x-2;j++)
- {
- if(y[j]<y[j+1])
- {
- temp = y[j];
- y[j] = y[j+1];
- y[j+1] = temp;
- }
- }
- }
- i = 0;
- while(sum/2>y[0])
- {
- y[0] += y[i+1];
- count += 1;
- i += 1;
- }
- if(count==1) printf("%s","Require 1 Party");
- else printf("Require %d Parties",count);
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement