/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|  23.1M|  auto operator+(node t) -> node {
   13|  23.1M|    return {u32(u64(t.a) * a % P), u32((u64(t.a) * b + t.b) % P)};
   14|  23.1M|  }
   15|  4.73M|  auto operator+(u32 x) -> u32 { return (u64(a) * x + b) % P; }
   16|  23.1M|  auto operator+=(node t) -> void { *this = *this + t; }
   17|       |} a[N];
   18|       |
   19|   499k|void pushdown(int k) {
   20|  9.97M|  for (int i = log(k) - 1; i >= 0; --i) {
                                                 ^9.47M
  ------------------
  |  Branch (20:28): [True: 94.99%, False: 5.01%]
  ------------------
   21|  9.47M|    node t = a[k >> i >> 1];
   22|  9.47M|    a[k >> i >> 1] = node{1, 0};
   23|  9.47M|    a[k >> i ^ 0] += t;
   24|  9.47M|    a[k >> i ^ 1] += t;
   25|  9.47M|  }
   26|   499k|}
   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|   500k|  for (int i = 0; i < n; ++i) a[i] = {1, 0}, a[n + i].b = rd.uw();
                                       ^500k^500k
  ------------------
  |  Branch (35:19): [True: 100.00%, False: 0.00%]
  ------------------
   36|   500k|  while (q--) {
  ------------------
  |  Branch (36:10): [True: 100.00%, False: 0.00%]
  ------------------
   37|   500k|    let t = rd.u1();
   38|   500k|    if (t == 0) {
  ------------------
  |  Branch (38:9): [True: 49.99%, False: 50.01%]
  ------------------
   39|   249k|      int l = n + rd.uh();
   40|   249k|      int r = n + rd.uh() - 1;
   41|   249k|      node x = {rd.uw(), rd.uw()};
   42|   249k|      pushdown(l--);
   43|   249k|      pushdown(r++);
   44|   249k|      int k = log(l ^ r);
   45|  2.33M|      for (int t = ~l & ~(-1 << k), i; t > 0; t -= 1 << i) {
                                                            ^2.08M
  ------------------
  |  Branch (45:40): [True: 89.29%, False: 10.71%]
  ------------------
   46|  2.08M|        i = log(t);
   47|  2.08M|        a[l >> i ^ 1] += x;
   48|  2.08M|      }
   49|  2.34M|      for (int t = +r & ~(-1 << k), i; t > 0; t -= 1 << i) {
                                                            ^2.09M
  ------------------
  |  Branch (49:40): [True: 89.32%, False: 10.68%]
  ------------------
   50|  2.09M|        i = log(t);
   51|  2.09M|        a[r >> i ^ 1] += x;
   52|  2.09M|      }
   53|   249k|    }
   54|   500k|    if (t == 1) {
  ------------------
  |  Branch (54:9): [True: 50.01%, False: 49.99%]
  ------------------
   55|   250k|      int k = n + rd.uh();
   56|   250k|      u32 x = a[k].b;
   57|  4.98M|      for (k /= 2; k > 0; k /= 2) x = a[k] + x;
                                        ^4.73M  ^4.73M
  ------------------
  |  Branch (57:20): [True: 94.99%, False: 5.01%]
  ------------------
   58|   250k|      wt.uw(x);
   59|   250k|    }
   60|   500k|  }
   61|      1|  return 0;
   62|      1|}