#include <iostream> #include <vector> using namespace std; using LL = long long; const LL MODULO = 998244353; vector<LL> values, counts; LL max_lose(LL n) { LL result = 0; ++n; while (n > 1) { n >>= 1; ++result; } return result; } LL seg_lower(LL lose_max) {...