/tmp/solutions/build/point_set_range_composite-fast.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|    877|  auto operator+(node t) -> node {
   13|    877|    return {u32(u64(a) * t.a % P), u32((u64(a) * t.b + b) % P)};
   14|    877|  }
   15|    623|  auto operator+(u32 x) -> u32 { return (u64(a) * x + b) % P; }
   16|       |} a[N];
   17|       |
   18|       |} // namespace
   19|       |
   20|      1|int main() {
   21|      1|  rd rd;
   22|      1|  wt wt;
   23|      1|  int n = rd.uh();
   24|      1|  int q = rd.uh();
   25|      4|  for (int i = 0; i < n; ++i) a[n + n - 1 - i] = {rd.uw(), rd.uw()};
                                       ^3   ^3
  ------------------
  |  Branch (25:19): [True: 75.00%, False: 25.00%]
  ------------------
   26|      3|  for (int i = n - 1; i >= 1; --i) a[i] = a[i * 2] + a[i * 2 + 1];
                                            ^2   ^2
  ------------------
  |  Branch (26:23): [True: 66.67%, False: 33.33%]
  ------------------
   27|  1.00k|  while (q--) {
  ------------------
  |  Branch (27:10): [True: 99.90%, False: 0.10%]
  ------------------
   28|  1.00k|    let t = rd.u1();
   29|  1.00k|    if (t == 0) {
  ------------------
  |  Branch (29:9): [True: 52.50%, False: 47.50%]
  ------------------
   30|    525|      int k = n + n - 1 - rd.uh();
   31|    525|      a[k] = {rd.uw(), rd.uw()};
   32|  1.40k|      for (k /= 2; k > 0; k /= 2) a[k] = a[k * 2] + a[k * 2 + 1];
                                        ^875    ^875
  ------------------
  |  Branch (32:20): [True: 62.50%, False: 37.50%]
  ------------------
   33|    525|    }
   34|  1.00k|    if (t == 1) {
  ------------------
  |  Branch (34:9): [True: 47.50%, False: 52.50%]
  ------------------
   35|    475|      int r = n + n - rd.uh();
   36|    475|      int l = n + n - 1 - rd.uh();
   37|    475|      u32 x = rd.uw();
   38|    475|      int k = log(l ^ r);
   39|    475|      int R = r >> k;
   40|    788|      for (r = r >> __builtin_ctz(r) ^ 1; r > R; r = r >> __builtin_ctz(r) ^ 1)
                                                               ^313
  ------------------
  |  Branch (40:43): [True: 39.72%, False: 60.28%]
  ------------------
   41|    313|        x = a[r] + x;
   42|    785|      for (int t = ~l & ~(-1 << k), i; t > 0; t -= 1 << i) {
                                                            ^310
  ------------------
  |  Branch (42:40): [True: 39.49%, False: 60.51%]
  ------------------
   43|    310|        i = log(t);
   44|    310|        x = a[l >> i ^ 1] + x;
   45|    310|      }
   46|    475|      wt.uw(x);
   47|    475|    }
   48|  1.00k|  }
   49|      1|  return 0;
   50|      1|}