#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    int n, s;
    cin >> n >> s;
    int a[n];
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
    }
    bool flag = true;
    for (int i = 0; i < n; ++i) {
      s -= a[i];
      if (s < 0) {
        cout << max_element(a, a + i + 1) - a + 1 << "\n";
        flag = false;
        break;
      }
    }
    if (flag) cout << 0 << "\n";
  }
  return 0;
}
