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