{"problem":{"name":"Ex - Min + Sum","description":{"content":"You are given two sequences of integers of length $N$: $A = (A_1, A_2, \\ldots, A_N)$ and $B = (B_1, B_2, \\ldots, B_N)$. Print the number of pairs of integers $(l, r)$ that satisfy $1 \\leq l \\leq r \\le","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc282_h"},"statements":[{"statement_type":"Markdown","content":"You are given two sequences of integers of length $N$: $A = (A_1, A_2, \\ldots, A_N)$ and $B = (B_1, B_2, \\ldots, B_N)$.\nPrint the number of pairs of integers $(l, r)$ that satisfy $1 \\leq l \\leq r \\leq N$ and the following condition.\n\n*   $\\min\\lbrace A_l, A_{l+1}, \\ldots, A_r \\rbrace + (B_l + B_{l+1} + \\cdots + B_r) \\leq S$\n\n## Constraints\n\n*   $1 \\leq N \\leq 2 \\times 10^5$\n*   $0 \\leq S \\leq 3 \\times 10^{14}$\n*   $0 \\leq A_i \\leq 10^{14}$\n*   $0 \\leq B_i \\leq 10^9$\n*   All values in the input are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $S$\n$A_1$ $A_2$ $\\ldots$ $A_N$\n$B_1$ $B_2$ $\\ldots$ $B_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc282_h","tags":[],"sample_group":[["4 15\n9 2 6 5\n3 5 8 9","6\n\nThe following six pairs of integers $(l, r)$ satisfy $1 \\leq l \\leq r \\leq N$ and the condition in the problem statement: $(1, 1)$, $(1, 2)$, $(2, 2)$, $(2, 3)$, $(3, 3)$, and $(4, 4)$."],["15 100\n39 9 36 94 40 26 12 26 28 66 73 85 62 5 20\n0 0 7 7 0 5 5 0 7 9 9 4 2 5 2","119"]],"created_at":"2026-03-03 11:01:13"}}