#include <bits/stdc++.h>
using namespace std;
long long t, n, s;
long long a[100000];
int main() {
  cin >> t;
  for (long long tt = 0; tt < t; tt++) {
    cin >> n >> s;
    long long sum = 0;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      sum += a[i];
    }
    if (sum <= s) {
      cout << "0" << endl;
    } else {
      sum = 0;
      long long max = 0;
      long long id_max = 0;
      long long i = 0;
      while (sum <= s) {
        if (max < a[i]) {
          max = a[i];
          id_max = i + 1;
        }
        sum += a[i];
        i++;
      }
      cout << id_max << endl;
    }
  }
}
