#include<iostream>
using namespace std;
int main()
{
int T, n, p, q, c = 0, i, w, t, arry[50];
cin >> T;
while(T--)
{
w = 0;
t = 0;
cin >> n >> p >> q;
for(i = 0; i < n; i++)
cin >> arry[i];
for(i = 0; i < n; i++)
{
if(w + arry[i] <= q && t+1 <= p)
{
w += arry[i];
t++;
}
}
cout << "Case " << ++c << ": " << t << endl;
}
return 0;
}
using namespace std;
int main()
{
int T, n, p, q, c = 0, i, w, t, arry[50];
cin >> T;
while(T--)
{
w = 0;
t = 0;
cin >> n >> p >> q;
for(i = 0; i < n; i++)
cin >> arry[i];
for(i = 0; i < n; i++)
{
if(w + arry[i] <= q && t+1 <= p)
{
w += arry[i];
t++;
}
}
cout << "Case " << ++c << ": " << t << endl;
}
return 0;
}
ahmed shuvo969
আহমেদ শুভ৯৬৯