QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#842783 | #9962. Diminishing Fractions | ucup-team087# | AC ✓ | 176ms | 109100kb | C++23 | 26.1kb | 2025-01-04 14:46:09 | 2025-01-04 14:46:17 |
Judging History
answer
#line 1 "library/my_template.hpp"
#if defined(LOCAL)
#include <my_template_compiled.hpp>
#else
// https://codeforces.com/blog/entry/96344
#pragma GCC optimize("Ofast,unroll-loops")
// いまの CF だとこれ入れると動かない?
// #pragma GCC target("avx2,popcnt")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i128 = __int128;
using u128 = unsigned __int128;
using f128 = __float128;
template <class T>
constexpr T infty = 0;
template <>
constexpr int infty<int> = 1'010'000'000;
template <>
constexpr ll infty<ll> = 2'020'000'000'000'000'000;
template <>
constexpr u32 infty<u32> = infty<int>;
template <>
constexpr u64 infty<u64> = infty<ll>;
template <>
constexpr i128 infty<i128> = i128(infty<ll>) * 2'000'000'000'000'000'000;
template <>
constexpr double infty<double> = infty<ll>;
template <>
constexpr long double infty<long double> = infty<ll>;
using pi = pair<ll, ll>;
using vi = vector<ll>;
template <class T>
using vc = vector<T>;
template <class T>
using vvc = vector<vc<T>>;
template <class T>
using vvvc = vector<vvc<T>>;
template <class T>
using vvvvc = vector<vvvc<T>>;
template <class T>
using vvvvvc = vector<vvvvc<T>>;
template <class T>
using pq = priority_queue<T>;
template <class T>
using pqg = priority_queue<T, vector<T>, greater<T>>;
#define vv(type, name, h, ...) vector<vector<type>> name(h, vector<type>(__VA_ARGS__))
#define vvv(type, name, h, w, ...) vector<vector<vector<type>>> name(h, vector<vector<type>>(w, vector<type>(__VA_ARGS__)))
#define vvvv(type, name, a, b, c, ...) \
vector<vector<vector<vector<type>>>> name(a, vector<vector<vector<type>>>(b, vector<vector<type>>(c, vector<type>(__VA_ARGS__))))
// https://trap.jp/post/1224/
#define FOR1(a) for (ll _ = 0; _ < ll(a); ++_)
#define FOR2(i, a) for (ll i = 0; i < ll(a); ++i)
#define FOR3(i, a, b) for (ll i = a; i < ll(b); ++i)
#define FOR4(i, a, b, c) for (ll i = a; i < ll(b); i += (c))
#define FOR1_R(a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR2_R(i, a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR3_R(i, a, b) for (ll i = (b)-1; i >= ll(a); --i)
#define overload4(a, b, c, d, e, ...) e
#define overload3(a, b, c, d, ...) d
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FOR_R(...) overload3(__VA_ARGS__, FOR3_R, FOR2_R, FOR1_R)(__VA_ARGS__)
#define all(x) x.begin(), x.end()
#define len(x) ll(x.size())
#define elif else if
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define stoi stoll
int popcnt(int x) { return __builtin_popcount(x); }
int popcnt(u32 x) { return __builtin_popcount(x); }
int popcnt(ll x) { return __builtin_popcountll(x); }
int popcnt(u64 x) { return __builtin_popcountll(x); }
int popcnt_sgn(int x) { return (__builtin_parity(unsigned(x)) & 1 ? -1 : 1); }
int popcnt_sgn(u32 x) { return (__builtin_parity(x) & 1 ? -1 : 1); }
int popcnt_sgn(ll x) { return (__builtin_parityll(x) & 1 ? -1 : 1); }
int popcnt_sgn(u64 x) { return (__builtin_parityll(x) & 1 ? -1 : 1); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 1, 2)
int topbit(int x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(u32 x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(ll x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
int topbit(u64 x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 0, 2)
int lowbit(int x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(u32 x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(ll x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
int lowbit(u64 x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
template <typename T>
T kth_bit(int k) {
return T(1) << k;
}
template <typename T>
bool has_kth_bit(T x, int k) {
return x >> k & 1;
}
template <typename UINT>
struct all_bit {
struct iter {
UINT s;
iter(UINT s) : s(s) {}
int operator*() const { return lowbit(s); }
iter &operator++() {
s &= s - 1;
return *this;
}
bool operator!=(const iter) const { return s != 0; }
};
UINT s;
all_bit(UINT s) : s(s) {}
iter begin() const { return iter(s); }
iter end() const { return iter(0); }
};
template <typename UINT>
struct all_subset {
static_assert(is_unsigned<UINT>::value);
struct iter {
UINT s, t;
bool ed;
iter(UINT s) : s(s), t(s), ed(0) {}
int operator*() const { return s ^ t; }
iter &operator++() {
(t == 0 ? ed = 1 : t = (t - 1) & s);
return *this;
}
bool operator!=(const iter) const { return !ed; }
};
UINT s;
all_subset(UINT s) : s(s) {}
iter begin() const { return iter(s); }
iter end() const { return iter(0); }
};
template <typename T>
T floor(T a, T b) {
return a / b - (a % b && (a ^ b) < 0);
}
template <typename T>
T ceil(T x, T y) {
return floor(x + y - 1, y);
}
template <typename T>
T bmod(T x, T y) {
return x - y * floor(x, y);
}
template <typename T>
pair<T, T> divmod(T x, T y) {
T q = floor(x, y);
return {q, x - q * y};
}
template <typename T, typename U>
T SUM(const vector<U> &A) {
T sm = 0;
for (auto &&a: A) sm += a;
return sm;
}
#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))
#define LB(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define UB(c, x) distance((c).begin(), upper_bound(all(c), (x)))
#define UNIQUE(x) sort(all(x)), x.erase(unique(all(x)), x.end()), x.shrink_to_fit()
template <typename T>
T POP(deque<T> &que) {
T a = que.front();
que.pop_front();
return a;
}
template <typename T>
T POP(pq<T> &que) {
T a = que.top();
que.pop();
return a;
}
template <typename T>
T POP(pqg<T> &que) {
T a = que.top();
que.pop();
return a;
}
template <typename T>
T POP(vc<T> &que) {
T a = que.back();
que.pop_back();
return a;
}
template <typename F>
ll binary_search(F check, ll ok, ll ng, bool check_ok = true) {
if (check_ok) assert(check(ok));
while (abs(ok - ng) > 1) {
auto x = (ng + ok) / 2;
(check(x) ? ok : ng) = x;
}
return ok;
}
template <typename F>
double binary_search_real(F check, double ok, double ng, int iter = 100) {
FOR(iter) {
double x = (ok + ng) / 2;
(check(x) ? ok : ng) = x;
}
return (ok + ng) / 2;
}
template <class T, class S>
inline bool chmax(T &a, const S &b) {
return (a < b ? a = b, 1 : 0);
}
template <class T, class S>
inline bool chmin(T &a, const S &b) {
return (a > b ? a = b, 1 : 0);
}
// ? は -1
vc<int> s_to_vi(const string &S, char first_char) {
vc<int> A(S.size());
FOR(i, S.size()) { A[i] = (S[i] != '?' ? S[i] - first_char : -1); }
return A;
}
template <typename T, typename U>
vector<T> cumsum(vector<U> &A, int off = 1) {
int N = A.size();
vector<T> B(N + 1);
FOR(i, N) { B[i + 1] = B[i] + A[i]; }
if (off == 0) B.erase(B.begin());
return B;
}
// stable sort
template <typename T>
vector<int> argsort(const vector<T> &A) {
vector<int> ids(len(A));
iota(all(ids), 0);
sort(all(ids), [&](int i, int j) { return (A[i] == A[j] ? i < j : A[i] < A[j]); });
return ids;
}
// A[I[0]], A[I[1]], ...
template <typename T>
vc<T> rearrange(const vc<T> &A, const vc<int> &I) {
vc<T> B(len(I));
FOR(i, len(I)) B[i] = A[I[i]];
return B;
}
template <typename T, typename... Vectors>
void concat(vc<T> &first, const Vectors &... others) {
vc<T> &res = first;
(res.insert(res.end(), others.begin(), others.end()), ...);
}
#endif
#line 1 "library/other/io.hpp"
#define FASTIO
#include <unistd.h>
// https://judge.yosupo.jp/submission/21623
namespace fastio {
static constexpr uint32_t SZ = 1 << 17;
char ibuf[SZ];
char obuf[SZ];
char out[100];
// pointer of ibuf, obuf
uint32_t pil = 0, pir = 0, por = 0;
struct Pre {
char num[10000][4];
constexpr Pre() : num() {
for (int i = 0; i < 10000; i++) {
int n = i;
for (int j = 3; j >= 0; j--) {
num[i][j] = n % 10 | '0';
n /= 10;
}
}
}
} constexpr pre;
inline void load() {
memcpy(ibuf, ibuf + pil, pir - pil);
pir = pir - pil + fread(ibuf + pir - pil, 1, SZ - pir + pil, stdin);
pil = 0;
if (pir < SZ) ibuf[pir++] = '\n';
}
inline void flush() {
fwrite(obuf, 1, por, stdout);
por = 0;
}
void rd(char &c) {
do {
if (pil + 1 > pir) load();
c = ibuf[pil++];
} while (isspace(c));
}
void rd(string &x) {
x.clear();
char c;
do {
if (pil + 1 > pir) load();
c = ibuf[pil++];
} while (isspace(c));
do {
x += c;
if (pil == pir) load();
c = ibuf[pil++];
} while (!isspace(c));
}
template <typename T>
void rd_real(T &x) {
string s;
rd(s);
x = stod(s);
}
template <typename T>
void rd_integer(T &x) {
if (pil + 100 > pir) load();
char c;
do
c = ibuf[pil++];
while (c < '-');
bool minus = 0;
if constexpr (is_signed<T>::value || is_same_v<T, i128>) {
if (c == '-') { minus = 1, c = ibuf[pil++]; }
}
x = 0;
while ('0' <= c) { x = x * 10 + (c & 15), c = ibuf[pil++]; }
if constexpr (is_signed<T>::value || is_same_v<T, i128>) {
if (minus) x = -x;
}
}
void rd(int &x) { rd_integer(x); }
void rd(ll &x) { rd_integer(x); }
void rd(i128 &x) { rd_integer(x); }
void rd(u32 &x) { rd_integer(x); }
void rd(u64 &x) { rd_integer(x); }
void rd(u128 &x) { rd_integer(x); }
void rd(double &x) { rd_real(x); }
void rd(long double &x) { rd_real(x); }
void rd(f128 &x) { rd_real(x); }
template <class T, class U>
void rd(pair<T, U> &p) {
return rd(p.first), rd(p.second);
}
template <size_t N = 0, typename T>
void rd_tuple(T &t) {
if constexpr (N < std::tuple_size<T>::value) {
auto &x = std::get<N>(t);
rd(x);
rd_tuple<N + 1>(t);
}
}
template <class... T>
void rd(tuple<T...> &tpl) {
rd_tuple(tpl);
}
template <size_t N = 0, typename T>
void rd(array<T, N> &x) {
for (auto &d: x) rd(d);
}
template <class T>
void rd(vc<T> &x) {
for (auto &d: x) rd(d);
}
void read() {}
template <class H, class... T>
void read(H &h, T &... t) {
rd(h), read(t...);
}
void wt(const char c) {
if (por == SZ) flush();
obuf[por++] = c;
}
void wt(const string s) {
for (char c: s) wt(c);
}
void wt(const char *s) {
size_t len = strlen(s);
for (size_t i = 0; i < len; i++) wt(s[i]);
}
template <typename T>
void wt_integer(T x) {
if (por > SZ - 100) flush();
if (x < 0) { obuf[por++] = '-', x = -x; }
int outi;
for (outi = 96; x >= 10000; outi -= 4) {
memcpy(out + outi, pre.num[x % 10000], 4);
x /= 10000;
}
if (x >= 1000) {
memcpy(obuf + por, pre.num[x], 4);
por += 4;
} else if (x >= 100) {
memcpy(obuf + por, pre.num[x] + 1, 3);
por += 3;
} else if (x >= 10) {
int q = (x * 103) >> 10;
obuf[por] = q | '0';
obuf[por + 1] = (x - q * 10) | '0';
por += 2;
} else
obuf[por++] = x | '0';
memcpy(obuf + por, out + outi + 4, 96 - outi);
por += 96 - outi;
}
template <typename T>
void wt_real(T x) {
ostringstream oss;
oss << fixed << setprecision(15) << double(x);
string s = oss.str();
wt(s);
}
void wt(int x) { wt_integer(x); }
void wt(ll x) { wt_integer(x); }
void wt(i128 x) { wt_integer(x); }
void wt(u32 x) { wt_integer(x); }
void wt(u64 x) { wt_integer(x); }
void wt(u128 x) { wt_integer(x); }
void wt(double x) { wt_real(x); }
void wt(long double x) { wt_real(x); }
void wt(f128 x) { wt_real(x); }
template <class T, class U>
void wt(const pair<T, U> val) {
wt(val.first);
wt(' ');
wt(val.second);
}
template <size_t N = 0, typename T>
void wt_tuple(const T t) {
if constexpr (N < std::tuple_size<T>::value) {
if constexpr (N > 0) { wt(' '); }
const auto x = std::get<N>(t);
wt(x);
wt_tuple<N + 1>(t);
}
}
template <class... T>
void wt(tuple<T...> tpl) {
wt_tuple(tpl);
}
template <class T, size_t S>
void wt(const array<T, S> val) {
auto n = val.size();
for (size_t i = 0; i < n; i++) {
if (i) wt(' ');
wt(val[i]);
}
}
template <class T>
void wt(const vector<T> val) {
auto n = val.size();
for (size_t i = 0; i < n; i++) {
if (i) wt(' ');
wt(val[i]);
}
}
void print() { wt('\n'); }
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
wt(head);
if (sizeof...(Tail)) wt(' ');
print(forward<Tail>(tail)...);
}
// gcc expansion. called automaticall after main.
void __attribute__((destructor)) _d() { flush(); }
} // namespace fastio
using fastio::read;
using fastio::print;
using fastio::flush;
#if defined(LOCAL)
#define SHOW(...) SHOW_IMPL(__VA_ARGS__, SHOW6, SHOW5, SHOW4, SHOW3, SHOW2, SHOW1)(__VA_ARGS__)
#define SHOW_IMPL(_1, _2, _3, _4, _5, _6, NAME, ...) NAME
#define SHOW1(x) print(#x, "=", (x)), flush()
#define SHOW2(x, y) print(#x, "=", (x), #y, "=", (y)), flush()
#define SHOW3(x, y, z) print(#x, "=", (x), #y, "=", (y), #z, "=", (z)), flush()
#define SHOW4(x, y, z, w) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w)), flush()
#define SHOW5(x, y, z, w, v) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w), #v, "=", (v)), flush()
#define SHOW6(x, y, z, w, v, u) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w), #v, "=", (v), #u, "=", (u)), flush()
#else
#define SHOW(...)
#endif
#define INT(...) \
int __VA_ARGS__; \
read(__VA_ARGS__)
#define LL(...) \
ll __VA_ARGS__; \
read(__VA_ARGS__)
#define U32(...) \
u32 __VA_ARGS__; \
read(__VA_ARGS__)
#define U64(...) \
u64 __VA_ARGS__; \
read(__VA_ARGS__)
#define STR(...) \
string __VA_ARGS__; \
read(__VA_ARGS__)
#define CHAR(...) \
char __VA_ARGS__; \
read(__VA_ARGS__)
#define DBL(...) \
double __VA_ARGS__; \
read(__VA_ARGS__)
#define VEC(type, name, size) \
vector<type> name(size); \
read(name)
#define VV(type, name, h, w) \
vector<vector<type>> name(h, vector<type>(w)); \
read(name)
void YES(bool t = 1) { print(t ? "YES" : "NO"); }
void NO(bool t = 1) { YES(!t); }
void Yes(bool t = 1) { print(t ? "Yes" : "No"); }
void No(bool t = 1) { Yes(!t); }
void yes(bool t = 1) { print(t ? "yes" : "no"); }
void no(bool t = 1) { yes(!t); }
void YA(bool t = 1) { print(t ? "YA" : "TIDAK"); }
void TIDAK(bool t = 1) { YES(!t); }
#line 3 "main.cpp"
#line 2 "library/nt/primetable.hpp"
template <typename T = int>
vc<T> primetable(int LIM) {
++LIM;
const int S = 32768;
static int done = 2;
static vc<T> primes = {2}, sieve(S + 1);
if (done < LIM) {
done = LIM;
primes = {2}, sieve.assign(S + 1, 0);
const int R = LIM / 2;
primes.reserve(int(LIM / log(LIM) * 1.1));
vc<pair<int, int>> cp;
for (int i = 3; i <= S; i += 2) {
if (!sieve[i]) {
cp.eb(i, i * i / 2);
for (int j = i * i; j <= S; j += 2 * i) sieve[j] = 1;
}
}
for (int L = 1; L <= R; L += S) {
array<bool, S> block{};
for (auto& [p, idx]: cp)
for (int i = idx; i < S + L; idx = (i += p)) block[i - L] = 1;
FOR(i, min(S, R - L)) if (!block[i]) primes.eb((L + i) * 2 + 1);
}
}
int k = LB(primes, LIM + 1);
return {primes.begin(), primes.begin() + k};
}
#line 2 "library/mod/mod_inv.hpp"
// long でも大丈夫
// (val * x - 1) が mod の倍数になるようにする
// 特に mod=0 なら x=0 が満たす
ll mod_inv(ll val, ll mod) {
if (mod == 0) return 0;
mod = abs(mod);
val %= mod;
if (val < 0) val += mod;
ll a = val, b = mod, u = 1, v = 0, t;
while (b > 0) {
t = a / b;
swap(a -= t * b, b), swap(u -= t * v, v);
}
if (u < 0) u += mod;
return u;
}
#line 2 "library/mod/modint_common.hpp"
struct has_mod_impl {
template <class T>
static auto check(T &&x) -> decltype(x.get_mod(), std::true_type{});
template <class T>
static auto check(...) -> std::false_type;
};
template <class T>
class has_mod : public decltype(has_mod_impl::check<T>(std::declval<T>())) {};
template <typename mint>
mint inv(int n) {
static const int mod = mint::get_mod();
static vector<mint> dat = {0, 1};
assert(0 <= n);
if (n >= mod) n %= mod;
while (len(dat) <= n) {
int k = len(dat);
int q = (mod + k - 1) / k;
dat.eb(dat[k * q - mod] * mint::raw(q));
}
return dat[n];
}
template <typename mint>
mint fact(int n) {
static const int mod = mint::get_mod();
assert(0 <= n && n < mod);
static vector<mint> dat = {1, 1};
while (len(dat) <= n) dat.eb(dat[len(dat) - 1] * mint::raw(len(dat)));
return dat[n];
}
template <typename mint>
mint fact_inv(int n) {
static vector<mint> dat = {1, 1};
if (n < 0) return mint(0);
while (len(dat) <= n) dat.eb(dat[len(dat) - 1] * inv<mint>(len(dat)));
return dat[n];
}
template <class mint, class... Ts>
mint fact_invs(Ts... xs) {
return (mint(1) * ... * fact_inv<mint>(xs));
}
template <typename mint, class Head, class... Tail>
mint multinomial(Head &&head, Tail &&... tail) {
return fact<mint>(head) * fact_invs<mint>(std::forward<Tail>(tail)...);
}
template <typename mint>
mint C_dense(int n, int k) {
assert(n >= 0);
if (k < 0 || n < k) return 0;
static vvc<mint> C;
static int H = 0, W = 0;
auto calc = [&](int i, int j) -> mint {
if (i == 0) return (j == 0 ? mint(1) : mint(0));
return C[i - 1][j] + (j ? C[i - 1][j - 1] : 0);
};
if (W <= k) {
FOR(i, H) {
C[i].resize(k + 1);
FOR(j, W, k + 1) { C[i][j] = calc(i, j); }
}
W = k + 1;
}
if (H <= n) {
C.resize(n + 1);
FOR(i, H, n + 1) {
C[i].resize(W);
FOR(j, W) { C[i][j] = calc(i, j); }
}
H = n + 1;
}
return C[n][k];
}
template <typename mint, bool large = false, bool dense = false>
mint C(ll n, ll k) {
assert(n >= 0);
if (k < 0 || n < k) return 0;
if constexpr (dense) return C_dense<mint>(n, k);
if constexpr (!large) return multinomial<mint>(n, k, n - k);
k = min(k, n - k);
mint x(1);
FOR(i, k) x *= mint(n - i);
return x * fact_inv<mint>(k);
}
template <typename mint, bool large = false>
mint C_inv(ll n, ll k) {
assert(n >= 0);
assert(0 <= k && k <= n);
if (!large) return fact_inv<mint>(n) * fact<mint>(k) * fact<mint>(n - k);
return mint(1) / C<mint, 1>(n, k);
}
// [x^d](1-x)^{-n}
template <typename mint, bool large = false, bool dense = false>
mint C_negative(ll n, ll d) {
assert(n >= 0);
if (d < 0) return mint(0);
if (n == 0) { return (d == 0 ? mint(1) : mint(0)); }
return C<mint, large, dense>(n + d - 1, d);
}
#line 3 "library/mod/modint.hpp"
template <int mod>
struct modint {
static constexpr u32 umod = u32(mod);
static_assert(umod < u32(1) << 31);
u32 val;
static modint raw(u32 v) {
modint x;
x.val = v;
return x;
}
constexpr modint() : val(0) {}
constexpr modint(u32 x) : val(x % umod) {}
constexpr modint(u64 x) : val(x % umod) {}
constexpr modint(u128 x) : val(x % umod) {}
constexpr modint(int x) : val((x %= mod) < 0 ? x + mod : x){};
constexpr modint(ll x) : val((x %= mod) < 0 ? x + mod : x){};
constexpr modint(i128 x) : val((x %= mod) < 0 ? x + mod : x){};
bool operator<(const modint &other) const { return val < other.val; }
modint &operator+=(const modint &p) {
if ((val += p.val) >= umod) val -= umod;
return *this;
}
modint &operator-=(const modint &p) {
if ((val += umod - p.val) >= umod) val -= umod;
return *this;
}
modint &operator*=(const modint &p) {
val = u64(val) * p.val % umod;
return *this;
}
modint &operator/=(const modint &p) {
*this *= p.inverse();
return *this;
}
modint operator-() const { return modint::raw(val ? mod - val : u32(0)); }
modint operator+(const modint &p) const { return modint(*this) += p; }
modint operator-(const modint &p) const { return modint(*this) -= p; }
modint operator*(const modint &p) const { return modint(*this) *= p; }
modint operator/(const modint &p) const { return modint(*this) /= p; }
bool operator==(const modint &p) const { return val == p.val; }
bool operator!=(const modint &p) const { return val != p.val; }
modint inverse() const {
int a = val, b = mod, u = 1, v = 0, t;
while (b > 0) {
t = a / b;
swap(a -= t * b, b), swap(u -= t * v, v);
}
return modint(u);
}
modint pow(ll n) const {
assert(n >= 0);
modint ret(1), mul(val);
while (n > 0) {
if (n & 1) ret *= mul;
mul *= mul;
n >>= 1;
}
return ret;
}
static constexpr int get_mod() { return mod; }
// (n, r), r は 1 の 2^n 乗根
static constexpr pair<int, int> ntt_info() {
if (mod == 120586241) return {20, 74066978};
if (mod == 167772161) return {25, 17};
if (mod == 469762049) return {26, 30};
if (mod == 754974721) return {24, 362};
if (mod == 880803841) return {23, 211};
if (mod == 943718401) return {22, 663003469};
if (mod == 998244353) return {23, 31};
if (mod == 1004535809) return {21, 582313106};
if (mod == 1012924417) return {21, 368093570};
return {-1, -1};
}
static constexpr bool can_ntt() { return ntt_info().fi != -1; }
};
#ifdef FASTIO
template <int mod>
void rd(modint<mod> &x) {
fastio::rd(x.val);
x.val %= mod;
// assert(0 <= x.val && x.val < mod);
}
template <int mod>
void wt(modint<mod> x) {
fastio::wt(x.val);
}
#endif
using modint107 = modint<1000000007>;
using modint998 = modint<998244353>;
#line 1 "library/nt/rational.hpp"
template <typename T = long long, bool REDUCE = true>
struct Rational {
T num, den;
Rational() : num(0), den(1) {}
Rational(T x) : num(x), den(1) {}
Rational(T a, T b, bool coprime = false) : num(a), den(b) {
if (den < 0) num = -num, den = -den;
if (!coprime && REDUCE) reduce();
}
static T gcd(T a, T b) {
a = max(a, -a), b = max(b, -b);
while (b) {
a %= b;
swap(a, b);
}
return a;
}
void reduce() {
if constexpr (!REDUCE) {
return;
} else {
T g = gcd(num, den);
num /= g, den /= g;
}
}
Rational &operator+=(const Rational &p) {
if constexpr (!REDUCE) {
num = num * p.den + p.num * den;
den *= p.den;
return *this;
} else {
T g = (REDUCE ? gcd(den, p.den) : 1);
num = num * (p.den / g) + p.num * (den / g);
den *= p.den / g;
reduce();
return *this;
}
}
Rational &operator-=(const Rational &p) {
if constexpr (!REDUCE) {
num = num * p.den - p.num * den;
den *= p.den;
return *this;
} else {
T g = (REDUCE ? gcd(den, p.den) : 1);
num = num * (p.den / g) - p.num * (den / g);
den *= p.den / g;
reduce();
return *this;
}
}
Rational &operator*=(const Rational &p) {
if constexpr (!REDUCE) {
num = num * p.num;
den = den * p.den;
return *this;
} else {
T g1 = gcd(num, p.den);
T g2 = gcd(den, p.num);
num = (num / g1) * (p.num / g2);
den = (den / g2) * (p.den / g1);
return *this;
}
}
Rational &operator/=(const Rational &p) {
T g1 = (REDUCE ? gcd(num, p.num) : 1);
T g2 = (REDUCE ? gcd(den, p.den) : 1);
num = (num / g1) * (p.den / g2);
den = (den / g2) * (p.num / g1);
if (den < 0) num = -num, den = -den;
return *this;
}
Rational operator-() const { return Rational(-num, den); }
Rational operator+(const Rational &p) const { return Rational(*this) += p; }
Rational operator-(const Rational &p) const { return Rational(*this) -= p; }
Rational operator*(const Rational &p) const { return Rational(*this) *= p; }
Rational operator/(const Rational &p) const { return Rational(*this) /= p; }
bool operator==(const Rational &p) const { return num * p.den == p.num * den; }
bool operator!=(const Rational &p) const { return num * p.den != p.num * den; }
bool operator<(const Rational &p) const { return num * p.den < p.num * den; }
bool operator>(const Rational &p) const { return num * p.den > p.num * den; }
bool operator<=(const Rational &p) const { return num * p.den <= p.num * den; }
bool operator>=(const Rational &p) const { return num * p.den >= p.num * den; }
string to_string() { return std::to_string(num) + "/" + std::to_string(den); }
double to_double() { return double(num) / double(den); }
};
#line 8 "main.cpp"
const int LIM = 50'000;
//
vc<int> primes;
vc<int> max_q;
vc<pair<int, int>> ppow;
/*
各素数に対して, 他の素べきの積全体を持っておく
*/
int table[5133][5218];
void init() {
primes = primetable(LIM);
for (auto& p: primes) {
ll q = 1;
while (q * p <= LIM) {
q *= p;
ppow.eb(q, p);
}
max_q.eb(q);
}
sort(all(ppow));
ll n = len(primes);
ll m = len(ppow);
FOR(i, n) table[i][0] = 1;
FOR(j, m) {
auto [q, p] = ppow[j];
FOR(i, n) {
if (primes[i] == p) {
table[i][j + 1] = table[i][j];
} else {
table[i][j + 1] = table[i][j] * ll(p) % max_q[i];
}
}
}
}
using Re = long double;
using mint = modint998;
void solve() {
INT(N);
if (N == 1) {
print("1/1");
return;
}
vc<pair<int, int>> ANS;
ll K = UB(ppow, mp(N, infty<int>));
mint sm = 0;
mint L = 1;
FOR(i, len(primes)) {
ll p = primes[i];
ll q = 1;
while (p * q <= N) q *= p;
if (q == 1) continue;
ll other = table[i][K];
ll x = mod_inv(other, q);
ANS.eb(x, q);
sm += mint(x) / q;
L *= q;
}
ll s = (sm - L.inverse()).val;
if (s != 0) { ANS.insert(ANS.begin(), pair<int, int>(-s, 1)); }
// Rational<ll> check;
// for (auto& [a, b]: ANS) check += Rational<ll>(a, b);
// print(check.to_string());
string out;
for (auto& [a, b]: ANS) {
if (out.empty()) {
out += to_string(a);
out += "/";
out += to_string(b);
} else {
assert(a > 0);
out += "+";
out += to_string(a);
out += "/";
out += to_string(b);
}
}
print(out);
}
signed main() {
init();
INT(T);
FOR(T) solve();
}
详细
Test #1:
score: 100
Accepted
time: 82ms
memory: 108664kb
input:
2 3 6
output:
-1/1+1/2+2/3 -2/1+3/4+2/3+3/5
result:
ok OK, t = 2
Test #2:
score: 0
Accepted
time: 79ms
memory: 108656kb
input:
1 1
output:
1/1
result:
ok OK, t = 1
Test #3:
score: 0
Accepted
time: 79ms
memory: 108620kb
input:
10 1 2 3 4 5 6 7 8 9 10
output:
1/1 1/2 -1/1+1/2+2/3 -1/1+3/4+1/3 -2/1+3/4+2/3+3/5 -2/1+3/4+2/3+3/5 -2/1+1/4+2/3+4/5+2/7 -1/1+1/8+1/3+2/5+1/7 -2/1+3/8+1/9+4/5+5/7 -2/1+3/8+1/9+4/5+5/7
result:
ok OK, t = 10
Test #4:
score: 0
Accepted
time: 83ms
memory: 108880kb
input:
54 7 20 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 3 47 81
output:
-2/1+1/4+2/3+4/5+2/7 -5/1+15/16+5/9+3/5+2/7+9/11+4/13+12/17+15/19 1/2 -1/1+1/2+2/3 -1/1+3/4+1/3 -2/1+3/4+2/3+3/5 -2/1+3/4+2/3+3/5 -2/1+1/4+2/3+4/5+2/7 -1/1+1/8+1/3+2/5+1/7 -2/1+3/8+1/9+4/5+5/7 -2/1+3/8+1/9+4/5+5/7 -2/1+1/8+5/9+4/5+3/7+1/11 -2/1+1/8+5/9+4/5+3/7+1/11 -4/1+5/8+8/9+3/5+4/7+6/11+10/13 -4...
result:
ok OK, t = 54
Test #5:
score: 0
Accepted
time: 84ms
memory: 108776kb
input:
92 51 54 57 60 63 66 69 72 75 78 81 84 87 90 93 96 99 102 105 108 111 114 117 120 123 126 129 132 135 138 141 144 147 150 153 156 159 162 165 168 171 174 177 180 183 186 189 192 195 198 201 204 207 210 213 216 219 222 225 228 231 234 237 240 243 246 249 252 255 258 261 264 267 270 273 276 279 282 28...
output:
-9/1+27/32+2/27+21/25+26/49+10/11+2/13+11/17+8/19+19/23+24/29+18/31+21/37+26/41+30/43+21/47 -8/1+15/32+25/27+7/25+31/49+6/11+2/13+14/17+17/19+6/23+1/29+29/31+36/37+9/41+3/43+27/47+11/53 -8/1+15/32+25/27+7/25+31/49+6/11+2/13+14/17+17/19+6/23+1/29+29/31+36/37+9/41+3/43+27/47+11/53 -8/1+29/32+5/27+23/2...
result:
ok OK, t = 92
Test #6:
score: 0
Accepted
time: 98ms
memory: 109040kb
input:
1000 622 149 839 472 292 345 799 941 449 15 907 494 48 430 505 66 83 97 10 548 286 644 528 249 573 860 557 932 746 262 971 157 603 715 984 333 53 916 784 649 70 768 780 64 118 616 979 466 24 2 517 774 566 419 182 222 40 169 951 830 977 383 355 770 134 973 917 3 854 31 35 825 109 945 671 536 952 888 ...
output:
-58/1+169/512+106/243+2/125+190/343+95/121+11/169+288/289+24/361+355/529+7/29+21/31+28/37+15/41+25/43+41/47+4/53+18/59+51/61+50/67+18/71+66/73+47/79+77/83+82/89+85/97+90/101+11/103+66/107+76/109+28/113+16/127+91/131+34/137+23/139+7/149+129/151+75/157+8/163+20/167+70/173+138/179+40/181+130/191+120/19...
result:
ok OK, t = 1000
Test #7:
score: 0
Accepted
time: 109ms
memory: 109008kb
input:
1000 1748 1741 1576 1940 1648 1825 1183 1447 1318 1277 1913 1208 1417 1388 1143 1581 1222 1904 1407 1006 1175 1218 1734 1934 1003 1704 1984 1399 1333 1840 1317 1233 1133 1232 1776 1881 1476 1712 1401 1231 1978 1964 1419 1644 1103 1498 1454 1480 1377 1352 1837 1616 1009 1413 1199 1977 1477 1579 1920 ...
output:
-135/1+275/1024+410/729+319/625+190/343+1226/1331+162/169+114/289+169/361+302/529+370/841+7/961+299/1369+958/1681+21/43+23/47+47/53+14/59+19/61+57/67+26/71+14/73+20/79+43/83+65/89+63/97+7/101+60/103+88/107+4/109+107/113+92/127+84/131+20/137+77/139+142/149+64/151+108/157+91/163+104/167+49/173+20/179+...
result:
ok OK, t = 1000
Test #8:
score: 0
Accepted
time: 131ms
memory: 109000kb
input:
1000 2107 2115 2985 2832 2564 2529 2971 2637 2666 2172 2496 2191 2465 2199 2260 2161 2402 2369 2762 2674 2734 2252 2488 2185 2652 2014 2018 2960 2313 2063 2696 2976 2457 2247 2180 2647 2907 2901 2912 2538 2512 2623 2267 2986 2348 2170 2131 2166 2563 2111 2860 2254 2462 2080 2054 2803 2397 2778 2411 ...
output:
-158/1+85/2048+596/729+193/625+214/343+167/1331+18/169+103/289+124/361+275/529+487/841+532/961+1087/1369+582/1681+91/1849+14/47+31/53+57/59+58/61+22/67+54/71+35/73+41/79+33/83+26/89+29/97+43/101+23/103+54/107+55/109+57/113+67/127+58/131+38/137+115/139+5/149+52/151+102/157+97/163+146/167+124/173+157/...
result:
ok OK, t = 1000
Test #9:
score: 0
Accepted
time: 144ms
memory: 108992kb
input:
1000 3416 3784 3793 3610 3982 3174 3253 3088 3197 3926 3664 3669 3431 3821 3340 3298 3498 3627 3194 3354 3362 3512 3865 3529 3988 3973 3852 3552 3672 3282 3035 3639 3998 3090 3771 3618 3402 3139 3903 3110 3452 3947 3941 3225 3187 3283 3243 3722 3808 3491 3309 3935 3937 3259 3909 3665 3809 3390 3285 ...
output:
-238/1+921/2048+1583/2187+3038/3125+2063/2401+101/1331+1412/2197+73/289+102/361+7/529+24/841+637/961+849/1369+1339/1681+931/1849+322/2209+2764/2809+30/59+58/61+10/67+1/71+37/73+10/79+11/83+81/89+37/97+29/101+54/103+20/107+20/109+23/113+21/127+106/131+102/137+43/139+17/149+41/151+22/157+48/163+104/16...
result:
ok OK, t = 1000
Test #10:
score: 0
Accepted
time: 155ms
memory: 109012kb
input:
899 4695 4616 4545 4771 4315 4850 4821 4722 4493 4338 4566 4144 4721 4334 4536 4313 4264 4669 4648 4780 4551 4044 4506 4798 4483 4372 4371 4636 4650 4590 4340 4383 4756 4104 4077 4067 4692 4008 4141 4610 4532 4751 4345 4498 4214 4621 4519 4505 4681 4726 4011 4879 4103 4283 4470 4844 4520 4740 4333 4...
output:
-318/1+2597/4096+1553/2187+487/3125+1742/2401+651/1331+144/2197+275/289+177/361+252/529+439/841+537/961+1060/1369+627/1681+547/1849+587/2209+1847/2809+554/3481+1664/3721+2220/4489+10/71+44/73+65/79+13/83+21/89+71/97+39/101+91/103+55/107+90/109+101/113+45/127+98/131+70/137+101/139+70/149+87/151+10/15...
result:
ok OK, t = 899
Test #11:
score: 0
Accepted
time: 152ms
memory: 109008kb
input:
1000 3798 4097 3356 3197 4364 3360 3927 4704 4072 3229 3681 3276 4187 4013 4014 3134 3743 3208 4792 3235 4788 3953 3313 4147 3230 3497 3181 4376 4631 3710 3602 4191 3405 3381 4722 3607 4374 3037 3149 3682 3557 3338 4471 3242 4470 4753 4637 3343 3625 4516 3505 3553 3626 3073 3222 4514 4402 4063 3372 ...
output:
-255/1+2037/2048+1064/2187+3074/3125+527/2401+772/1331+1793/2197+172/289+60/361+29/529+791/841+827/961+1154/1369+1633/1681+1084/1849+327/2209+482/2809+122/3481+2786/3721+53/67+55/71+43/73+55/79+59/83+5/89+57/97+99/101+17/103+56/107+17/109+51/113+115/127+58/131+19/137+129/139+4/149+55/151+56/157+1/16...
result:
ok OK, t = 1000
Test #12:
score: 0
Accepted
time: 164ms
memory: 108804kb
input:
474 7545 5913 9012 7937 9033 8958 6042 9802 6773 7104 7992 7475 7128 5208 6469 5645 7483 49664 7929 9114 8828 7916 9405 6829 8448 8454 9204 7795 5960 6310 9545 49393 8789 5482 8149 7405 8428 7210 5902 8761 5209 8251 7599 9264 5237 8710 6878 8842 5430 9871 8230 8959 9001 8926 9201 5003 8737 7628 7133...
output:
-481/1+117/4096+4606/6561+2117/3125+1928/2401+488/1331+1865/2197+2833/4913+40/6859+58/529+437/841+944/961+970/1369+92/1681+477/1849+1977/2209+860/2809+1892/3481+1004/3721+769/4489+3978/5041+1939/5329+3261/6241+547/6889+62/89+76/97+29/101+65/103+89/107+63/109+37/113+62/127+82/131+59/137+127/139+40/14...
result:
ok OK, t = 474
Test #13:
score: 0
Accepted
time: 168ms
memory: 109100kb
input:
505 654 4006 658 39050 749 2525 45144 8 107 366 181 1161 49410 315 24 1125 56 2895 4689 19600 861 18 17643 27130 4321 20973 43326 5761 3127 514 4286 286 55 4733 1114 1022 540 15500 47 158 2168 529 428 41729 1778 83 53 904 416 25550 134 475 2624 386 13073 4799 16 484 27746 7 35604 37 1814 1384 45 377...
output:
-57/1+99/512+136/243+149/625+251/343+35/121+147/169+251/289+162/361+74/529+7/29+11/31+13/37+8/41+28/43+42/47+30/53+24/59+41/61+4/67+58/71+31/73+6/79+68/83+60/89+69/97+51/101+80/103+65/107+3/109+16/113+21/127+70/131+46/137+21/139+144/149+98/151+156/157+133/163+60/167+58/173+177/179+153/181+148/191+77...
result:
ok OK, t = 505
Test #14:
score: 0
Accepted
time: 174ms
memory: 108756kb
input:
164 5348 13781 10630 42085 48735 22502 30143 8994 17829 40332 4188 40168 2858 4539 27532 42223 44889 33093 47647 8530 48824 812 14976 32746 29270 44536 33166 2354 27686 630 43523 32120 38166 6687 1125 45588 46641 42232 29120 11682 17398 3236 7499 48684 43474 11053 182 13451 43129 35818 15957 11254 4...
output:
-352/1+757/4096+674/2187+989/3125+2301/2401+18/1331+1102/2197+131/4913+344/361+393/529+127/841+439/961+587/1369+1393/1681+930/1849+509/2209+2570/2809+1943/3481+413/3721+2705/4489+4721/5041+3510/5329+27/79+39/83+51/89+46/97+93/101+95/103+95/107+63/109+5/113+113/127+90/131+67/137+77/139+96/149+123/151...
result:
ok OK, t = 164
Test #15:
score: 0
Accepted
time: 176ms
memory: 109012kb
input:
156 11299 49780 39754 44360 13750 33643 31382 48665 22685 25974 3679 15594 20849 11844 40645 20943 26660 48724 29993 21829 26251 7053 15218 29474 31529 31754 2823 4866 17437 40827 38285 3116 32140 37739 3831 29989 28174 13666 24668 41569 45278 43765 47564 39670 35238 28460 21784 45880 9557 38904 499...
output:
-692/1+7077/8192+1588/6561+2944/3125+1969/2401+1006/1331+451/2197+3797/4913+2370/6859+433/529+443/841+879/961+283/1369+73/1681+1683/1849+606/2209+2253/2809+2900/3481+145/3721+3386/4489+2917/5041+2070/5329+3527/6241+3736/6889+3230/7921+4302/9409+8038/10201+9430/10609+68/107+4/109+89/113+23/127+13/131...
result:
ok OK, t = 156
Test #16:
score: 0
Accepted
time: 165ms
memory: 108808kb
input:
89 42615 41319 46294 44842 45088 40377 45143 42991 47088 47811 44569 40910 41531 49894 45027 47842 48327 48243 49764 46548 46950 41965 49765 49084 41705 40820 48320 46963 42990 42063 42431 46354 40397 39081 47952 45441 41398 40985 45235 47640 44526 41162 40397 47458 46986 49919 45345 49801 43912 425...
output:
-2204/1+41/32768+17947/19683+424/15625+2904/16807+2264/14641+28519/28561+1497/4913+6735/6859+6549/12167+23058/24389+26650/29791+1224/1369+380/1681+850/1849+831/2209+1539/2809+2329/3481+3092/3721+4121/4489+4997/5041+3755/5329+4319/6241+5786/6889+1992/7921+1650/9409+6919/10201+7956/10609+6279/11449+10...
result:
ok OK, t = 89
Test #17:
score: 0
Accepted
time: 159ms
memory: 109016kb
input:
708 8690 6897 1563 9172 7717 7283 5164 2859 7604 6259 5595 8855 7487 5464 2724 1949 6643 6878 8975 4077 9549 1489 2960 4831 4874 5669 7869 5594 1092 9912 3233 4090 7631 5734 6151 4286 5171 7006 6875 2487 2383 5073 1110 3362 3032 6497 7582 7001 5070 4532 8695 2019 3678 2955 2379 9183 3355 8851 3049 8...
output:
-537/1+7979/8192+1697/6561+1994/3125+34/2401+1248/1331+875/2197+4889/4913+6181/6859+117/529+249/841+526/961+500/1369+1532/1681+1723/1849+36/2209+1655/2809+2606/3481+1152/3721+3669/4489+829/5041+3554/5329+4904/6241+2013/6889+2254/7921+35/97+32/101+48/103+14/107+16/109+31/113+53/127+89/131+82/137+24/1...
result:
ok OK, t = 708
Test #18:
score: 0
Accepted
time: 150ms
memory: 108948kb
input:
84 48657 48005 48587 46114 48091 46487 49367 46438 46342 49209 49724 46640 49786 48261 48525 48488 46034 46558 48181 48315 47021 46848 48476 49853 48898 49808 46580 46793 46961 49425 47721 48827 48081 47505 47240 49031 46320 47091 47584 49823 46483 46527 49809 48285 49970 46559 46599 47692 49083 490...
output:
-2531/1+28837/32768+9544/19683+8962/15625+2435/16807+3312/14641+26576/28561+193/4913+5407/6859+11824/12167+7120/24389+16188/29791+603/1369+378/1681+200/1849+70/2209+191/2809+2022/3481+1394/3721+208/4489+23/5041+5274/5329+2501/6241+2134/6889+4602/7921+1018/9409+462/10201+9182/10609+3473/11449+60/1188...
result:
ok OK, t = 84
Test #19:
score: 0
Accepted
time: 148ms
memory: 109048kb
input:
80 49938 49968 49950 49924 49989 49971 49926 49999 49982 49930 49974 49957 49947 49992 49948 49941 49998 49967 49978 49965 49997 49963 49923 49981 49958 49975 49937 49942 49996 49993 49979 49961 49931 49956 49944 49987 49953 49933 49943 50000 49970 49940 49990 49927 49951 49955 49934 49994 49972 499...
output:
-2550/1+3721/32768+19006/19683+10263/15625+3688/16807+11575/14641+6514/28561+174/4913+4926/6859+1330/12167+15727/24389+21554/29791+11/1369+499/1681+968/1849+640/2209+1339/2809+1537/3481+1873/3721+1585/4489+3547/5041+4590/5329+3442/6241+5331/6889+370/7921+5890/9409+7821/10201+643/10609+7232/11449+304...
result:
ok OK, t = 80
Test #20:
score: 0
Accepted
time: 151ms
memory: 108824kb
input:
81 49999 49993 49991 49957 49943 49939 49937 49927 49921 49919 49891 49877 49871 49853 49843 49831 49823 49811 49807 49801 49789 49787 49783 49757 49747 49741 49739 49729 49727 49711 49697 49681 49669 49667 49663 49639 49633 49627 49613 49603 49597 49559 49549 49547 49537 49531 49529 49523 49499 494...
output:
-2547/1+19953/32768+8914/19683+2866/15625+6179/16807+8714/14641+26246/28561+3061/4913+2680/6859+6499/12167+5025/24389+10624/29791+264/1369+1225/1681+1398/1849+1080/2209+2698/2809+2703/3481+2032/3721+3975/4489+19/5041+325/5329+6102/6241+4025/6889+3881/7921+383/9409+6631/10201+2569/10609+8470/11449+71...
result:
ok OK, t = 81
Test #21:
score: 0
Accepted
time: 143ms
memory: 108816kb
input:
83 48990 48988 48972 48952 48946 48906 48888 48882 48870 48868 48858 48856 48846 48822 48820 48816 48808 48798 48786 48780 48778 48766 48760 48756 48750 48732 48730 48678 48676 48672 48660 48648 48646 48622 48618 48610 48592 48588 48570 48562 48540 48538 48532 48526 48522 48496 48490 48486 48480 484...
output:
-2531/1+17613/32768+19291/19683+2884/15625+4421/16807+654/14641+5709/28561+3119/4913+858/6859+10628/12167+20714/24389+11429/29791+149/1369+1350/1681+33/1849+734/2209+1494/2809+1833/3481+3458/3721+1179/4489+2631/5041+4485/5329+3174/6241+3741/6889+2416/7921+2206/9409+137/10201+10363/10609+153/11449+49...
result:
ok OK, t = 83
Test #22:
score: 0
Accepted
time: 163ms
memory: 108800kb
input:
91 49999 49877 49747 49613 49481 49339 49211 49081 48953 48823 48679 48541 48413 48281 48157 48029 47903 47779 47657 47533 47407 47279 47149 47017 46889 46757 46633 46511 46381 46237 46103 45979 45853 45707 45569 45439 45317 45191 45061 44939 44809 44687 44563 44417 44293 44171 44041 43913 43789 436...
output:
-2547/1+19953/32768+8914/19683+2866/15625+6179/16807+8714/14641+26246/28561+3061/4913+2680/6859+6499/12167+5025/24389+10624/29791+264/1369+1225/1681+1398/1849+1080/2209+2698/2809+2703/3481+2032/3721+3975/4489+19/5041+325/5329+6102/6241+4025/6889+3881/7921+383/9409+6631/10201+2569/10609+8470/11449+71...
result:
ok OK, t = 91
Extra Test:
score: 0
Extra Test Passed