/tmp/solutions/build/range_affine_point_get-main.cpp:
    1|       |#include <common.h>
    2|       |#include <toy/bit.h>
    3|       |prelude;
    4|       |
    5|       |namespace {
    6|       |
    7|       |constexpr int N = 1e6;
    8|       |constexpr int P = 998244353;
    9|       |
   10|       |struct node {
   11|       |  u32 a, b;
   12|  7.82k|  auto operator+(node t) -> node {
   13|  7.82k|    return {u32(u64(t.a) * a % P), u32((u64(t.a) * b + t.b) % P)};
   14|  7.82k|  }
   15|  1.70k|  auto operator+(u32 x) -> u32 { return (u64(a) * x + b) % P; }
   16|  7.82k|  auto operator+=(node t) -> void { *this = *this + t; }
   17|       |} a[N];
   18|       |
   19|    998|void pushdown(int k) {
   20|  4.40k|  for (int i = log(k) - 1; i >= 0; --i) {
                                                 ^3.40k
  ------------------
  |  Branch (20:28): [True: 77.32%, False: 22.68%]
  ------------------
   21|  3.40k|    node t = a[k >> i >> 1];
   22|  3.40k|    a[k >> i >> 1] = node{1, 0};
   23|  3.40k|    a[k >> i ^ 0] += t;
   24|  3.40k|    a[k >> i ^ 1] += t;
   25|  3.40k|  }
   26|    998|}
   27|       |
   28|       |} // namespace
   29|       |
   30|      1|int main() {
   31|      1|  rd rd;
   32|      1|  wt wt;
   33|      1|  int n = rd.uh();
   34|      1|  int q = rd.uh();
   35|     11|  for (int i = 0; i < n; ++i) a[i] = {1, 0}, a[n + i].b = rd.uw();
                                       ^10  ^10
  ------------------
  |  Branch (35:19): [True: 90.91%, False: 9.09%]
  ------------------
   36|  1.00k|  while (q--) {
  ------------------
  |  Branch (36:10): [True: 99.90%, False: 0.10%]
  ------------------
   37|  1.00k|    let t = rd.u1();
   38|  1.00k|    if (t == 0) {
  ------------------
  |  Branch (38:9): [True: 49.90%, False: 50.10%]
  ------------------
   39|    499|      int l = n + rd.uh();
   40|    499|      int r = n + rd.uh() - 1;
   41|    499|      node x = {rd.uw(), rd.uw()};
   42|    499|      pushdown(l--);
   43|    499|      pushdown(r++);
   44|    499|      int k = log(l ^ r);
   45|  1.04k|      for (int t = ~l & ~(-1 << k), i; t > 0; t -= 1 << i) {
                                                            ^545
  ------------------
  |  Branch (45:40): [True: 52.20%, False: 47.80%]
  ------------------
   46|    545|        i = log(t);
   47|    545|        a[l >> i ^ 1] += x;
   48|    545|      }
   49|    971|      for (int t = +r & ~(-1 << k), i; t > 0; t -= 1 << i) {
                                                            ^472
  ------------------
  |  Branch (49:40): [True: 48.61%, False: 51.39%]
  ------------------
   50|    472|        i = log(t);
   51|    472|        a[r >> i ^ 1] += x;
   52|    472|      }
   53|    499|    }
   54|  1.00k|    if (t == 1) {
  ------------------
  |  Branch (54:9): [True: 50.10%, False: 49.90%]
  ------------------
   55|    501|      int k = n + rd.uh();
   56|    501|      u32 x = a[k].b;
   57|  2.20k|      for (k /= 2; k > 0; k /= 2) x = a[k] + x;
                                        ^1.70k  ^1.70k
  ------------------
  |  Branch (57:20): [True: 77.27%, False: 22.73%]
  ------------------
   58|    501|      wt.uw(x);
   59|    501|    }
   60|  1.00k|  }
   61|      1|  return 0;
   62|      1|}