{"raw_statement":[{"iden":"statement","content":"Given the length $n$ of an array $A$ such that all $A_i$ $=$ $0$ for all $1 <= i <= n$.\n\nYou need to answer $q$ queries of two types:\n\n1) $1$ $l$ $r$ print 1 if all values of $A_i$, such that $l <= i <= r$, are equal.\n\n2) $2$ $l$ $r$ $a$ $b$ update the range $l$ $r$ with the arithmetic progression $a + b * (i -l)$.\n\nFor example if $l = 2$, $r = 5$, $a = 4$, and $b = 3$ then:\n\n$A_2 = A_2 + 4$\n\n$A_3 = A_3 + 4 + 3$\n\n$A_4 = A_4 + 4 + 2 * 3$\n\n$A_5 = A_5 + 4 + 3 * 3$\n\nFirst line contains two integers $n$ and $q$ $(1 <= n, q <= 2 * 10^5)$.\n\nEach of the next q lines follow one of two formates:\n\n1) $1$ $l$ $r$ $(1 <= l <= r <= n)$\n\n2) $2$ $l$ $r$ $a$ $b$ $(-10^8 <= a, b <= 10^8)$\n\nFor each query of the second type print $1$ if the range is made up of the same value and $0$ if it's not.\n\n"},{"iden":"input","content":"First line contains two integers $n$ and $q$ $(1 <= n, q <= 2 * 10^5)$.Each of the next q lines follow one of two formates:1) $1$ $l$ $r$ $(1 <= l <= r <= n)$2) $2$ $l$ $r$ $a$ $b$ $(-10^8 <= a, b <= 10^8)$"},{"iden":"output","content":"For each query of the second type print $1$ if the range is made up of the same value and $0$ if it's not."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n, q \\in \\mathbb{Z}^+ $ with $ 1 \\le n, q \\le 2 \\cdot 10^5 $.  \nLet $ A = (A_1, A_2, \\dots, A_n) $ be an array of integers initialized as $ A_i = 0 $ for all $ i \\in \\{1, \\dots, n\\} $.\n\n**Constraints**  \n1. For each query:  \n   - Type 1: $ 1 \\le l \\le r \\le n $  \n   - Type 2: $ 1 \\le l \\le r \\le n $, $ -10^8 \\le a, b \\le 10^8 $\n\n**Operations**  \nFor a query of type $ 1\\ l\\ r $:  \nOutput $ 1 $ if $ \\forall i,j \\in [l, r],\\ A_i = A_j $; otherwise output $ 0 $.\n\nFor a query of type $ 2\\ l\\ r\\ a\\ b $:  \nFor each $ i \\in [l, r] $, update:  \n$$\nA_i \\gets A_i + a + b \\cdot (i - l)\n$$\n\n**Objective**  \nFor each query of type 1, output $ \\mathbb{I}\\left( \\forall i,j \\in [l,r],\\ A_i = A_j \\right) $, where $ \\mathbb{I} $ is the indicator function.","simple_statement":"Given an array of n zeros, process q queries:\n\n1) Check if all elements in range [l, r] are equal → print 1 if yes, 0 if no.\n2) Add an arithmetic sequence to range [l, r]: start with a, increase by b each step → A[l] += a, A[l+1] += a+b, A[l+2] += a+2b, ..., A[r] += a+(r-l)*b.\n\nFor each query of type 1, output 1 or 0.","has_page_source":false}