public void solve() throws IOException {
    int tests = nextInt();
    for (int t = 0; t < tests; t++) {
      int n = nextInt();
      long p = nextLong();
      
      long[] in = new long[n];
      long[] sums = new long[n];
      for (int i = 0; i < n; i++) {
        long input = nextLong();
        in[i] = input;
        if (i == 0) {
          sums[i] = input;
        } else {
          sums[i] = sums[i - 1] + input;
        }
      }
      
      long total = 0;
      for (int i = 0; i < n; i++) {
        if (in[i] > p) {
          continue;
        }
        long target = sums[i] + (p - in[i]);
        int search = Arrays.binarySearch(sums, i, n, target);
        if (search >= 0) {
          total += search + 1 - i;
        } else {
          int insertion = (search + 1) * -1;
          total += insertion - i;
          //System.out.println(i + " " + insertion);
        }
      }
      System.out.format("Case #%d: %d%n", t + 1, total);
    }
  }