#include <bits/stdc++.h>
using namespace std;
struct dob {
  long long v, sum;
};
int t, n;
long long s, x, sum, c, cant, may, j, answer, u;
dob arr[100005];
bool b1;
int main() {
  scanf("%d", &t);
  for (int k = 0; k < t; k++) {
    scanf("%d%lld", &n, &s);
    b1 = false;
    c = 0;
    u = 0;
    may = 0;
    cant = 0;
    answer = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%lld", &arr[i].v);
      arr[i].sum = arr[i - 1].sum + arr[i].v;
    }
    for (int i = 1; i <= n; i++) {
      x = arr[i].v;
      if (x > may) {
        may = x;
        j = i;
      }
      if (arr[i].sum - c > s and b1 == false) {
        c = may;
        answer = j;
        b1 = true;
      }
      if (arr[i].sum - c > s) {
        break;
      }
    }
    printf("%lld\n", answer);
  }
  return 0;
}
