5 8 6 10 5 7
6
We have $A=(8,6,10,5,7)$.
For example, $(l,r)=(1,2)$ satisfies the condition because $A_l+A_{l+1}+\cdots+A_r=A_1+A_2=14$, and neither $A_1=8$ nor $A_2=6$ is a divisor of $14$.
On the other hand, $(l,r)=(1,3)$ does not satisfy the condition because $A_l+A_{l+1}+\cdots+A_r=A_1+A_2+A_3=24$, and $A_1=8$ is a divisor of $24$.
The pairs that satisfy the condition are $(l,r)=(1,2), (1,4), (2,3), (2,4), (3,5), (4,5)$, which is six pairs, so output $6$.3 1 1 1
0
{
"problem": {
"name": "No-Divisible Range",
"description": {
"content": "You are given a sequence of positive integers $A=(A_1,A_2,\\ldots,A_N)$ of length $N$. Find the number of pairs of integers $(l,r)$ satisfying $1\\leq l\\leq r\\leq N$ that satisfy the following conditi",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc435_b"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given a sequence of positive integers $A=(A_1,A_2,\\ldots,A_N)$ of length $N$. \nFind the number of pairs of integers $(l,r)$ satisfying $1\\leq l\\leq r\\leq N$ that satisfy the following conditi...",
"is_translate": false,
"language": "English"
}
]
}