#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, s, su = 0;
    cin >> n >> s;
    long long int a[n], max1 = INT_MIN, ss = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      ss += a[i];
    }
    long long int j = 0, in;
    for (int i = 0; i < n; i++) {
      su += a[i];
      if (su > s) {
        j = i;
        break;
      }
    }
    for (int i = 0; i <= j; i++) {
      if (max1 <= a[i]) {
        max1 = a[i];
        in = i + 1;
      }
    }
    if (ss <= s)
      cout << 0 << endl;
    else
      cout << in << endl;
  }
  return 0;
}
