#include<cstdio> using namespace std; int main() { int tc,c=1; scanf("%d",&tc); while (tc--) { int n,p,q,w[30],i,s=0; scanf("%d%d%d",&n,&p,&q); for (i=0;i<n;i++) scanf("%d",&w[i]); for (i=0;i<n && i<p;i++) { s+=w[i]; if (s>q) break; } printf("Case %d: %d\n",c++,i); } return 0; }
Tuesday, July 19, 2016
Unknown
Studying at Shahjalal University of Science and Technology, Sylhet.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment