#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long n, s;
    cin >> n >> s;
    long long a[n], i, sum = 0, mxf = -1, mx = 0, mxi = -1;
    for (i = 0; i < n; i++) {
      cin >> a[i];
      sum += a[i];
      if (a[i] > mx) {
        mx = a[i];
        mxi = i;
      }
      if (sum > s && mxf == -1) mxf = mxi;
    }
    if (mxf == -1)
      cout << 0 << endl;
    else
      cout << mxf + 1 << endl;
  }
}
