#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
long long a[maxn], pre[maxn], n, s;
void solve() {
  cin >> n >> s;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    pre[i] = pre[i - 1] + a[i];
  }
  if (pre[n] <= s) {
    puts("0");
    return;
  }
  int ans = 0, u = 0;
  for (int i = 1; i <= n && s >= pre[i - 1]; i++) {
    int t = upper_bound(pre + 1, pre + 1 + n, s + a[i]) - pre - 1;
    if (t > u) {
      ans = i, u = t;
    }
  }
  cout << ans << endl;
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    solve();
  }
  return 0;
}
