#include <bits/stdc++.h>
using namespace std;
long long sp[100005], v[100005];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int r = 0, n, a = 0;
    long long s;
    cin >> n >> s;
    for (int i = 1; i <= n; ++i) {
      cin >> v[i];
      sp[i] = sp[i - 1] + v[i];
    }
    if (sp[n] <= s) {
      cout << "0\n";
      continue;
    }
    for (int i = 1; i <= n; ++i) {
      int st = i, dr = n, mij, ans = 0;
      while (st <= dr) {
        mij = (st + dr) / 2;
        if (sp[mij] - v[i] <= s) {
          ans = mij;
          st = mij + 1;
        } else
          dr = mij - 1;
      }
      if (ans - 1 > r) r = ans - 1, a = i;
    }
    cout << a << '\n';
  }
  return 0;
}
