QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#427463 | #8777. Passport Stamps | ucup-team112# | AC ✓ | 8ms | 4076kb | C++20 | 11.9kb | 2024-06-01 13:23:20 | 2024-06-01 13:23:21 |
Judging History
answer
// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
// #define INTERACTIVE
#include <bits/stdc++.h>
using namespace std;
namespace templates {
// type
using ll = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
using Pil = pair<int, ll>;
using Pli = pair<ll, int>;
using Pll = pair<ll, ll>;
template <class T>
using pq = priority_queue<T>;
template <class T>
using qp = priority_queue<T, vector<T>, greater<T>>;
// clang-format off
#define vec(T, A, ...) vector<T> A(__VA_ARGS__);
#define vvec(T, A, h, ...) vector<vector<T>> A(h, vector<T>(__VA_ARGS__));
#define vvvec(T, A, h1, h2, ...) vector<vector<vector<T>>> A(h1, vector<vector<T>>(h2, vector<T>(__VA_ARGS__)));
// clang-format on
// for loop
#define fori1(a) for (ll _ = 0; _ < (a); _++)
#define fori2(i, a) for (ll i = 0; i < (a); i++)
#define fori3(i, a, b) for (ll i = (a); i < (b); i++)
#define fori4(i, a, b, c) for (ll i = (a); ((c) > 0 || i > (b)) && ((c) < 0 || i < (b)); i += (c))
#define overload4(a, b, c, d, e, ...) e
#define fori(...) overload4(__VA_ARGS__, fori4, fori3, fori2, fori1)(__VA_ARGS__)
// declare and input
// clang-format off
#define INT(...) int __VA_ARGS__; inp(__VA_ARGS__);
#define LL(...) ll __VA_ARGS__; inp(__VA_ARGS__);
#define STRING(...) string __VA_ARGS__; inp(__VA_ARGS__);
#define CHAR(...) char __VA_ARGS__; inp(__VA_ARGS__);
#define DOUBLE(...) double __VA_ARGS__; STRING(str___); __VA_ARGS__ = stod(str___);
#define VEC(T, A, n) vector<T> A(n); inp(A);
#define VVEC(T, A, n, m) vector<vector<T>> A(n, vector<T>(m)); inp(A);
// clang-format on
// const value
const ll MOD1 = 1000000007;
const ll MOD9 = 998244353;
const double PI = acos(-1);
// other macro
#if !defined(RIN__LOCAL) && !defined(INTERACTIVE)
#define endl "\n"
#endif
#define spa ' '
#define len(A) ll(A.size())
#define all(A) begin(A), end(A)
// function
vector<char> stoc(string &S) {
int n = S.size();
vector<char> ret(n);
for (int i = 0; i < n; i++) ret[i] = S[i];
return ret;
}
string ctos(vector<char> &S) {
int n = S.size();
string ret = "";
for (int i = 0; i < n; i++) ret += S[i];
return ret;
}
template <class T>
auto min(const T &a) {
return *min_element(all(a));
}
template <class T>
auto max(const T &a) {
return *max_element(all(a));
}
template <class T, class S>
auto clamp(T &a, const S &l, const S &r) {
return (a > r ? r : a < l ? l : a);
}
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);
}
template <class T, class S>
inline bool chclamp(T &a, const S &l, const S &r) {
auto b = clamp(a, l, r);
return (a != b ? a = b, 1 : 0);
}
template <typename T>
T sum(vector<T> &A) {
T tot = 0;
for (auto a : A) tot += a;
return tot;
}
template <typename T>
vector<T> compression(vector<T> X) {
sort(all(X));
X.erase(unique(all(X)), X.end());
return X;
}
// input and output
namespace io {
// __int128_t
std::ostream &operator<<(std::ostream &dest, __int128_t value) {
std::ostream::sentry s(dest);
if (s) {
__uint128_t tmp = value < 0 ? -value : value;
char buffer[128];
char *d = std::end(buffer);
do {
--d;
*d = "0123456789"[tmp % 10];
tmp /= 10;
} while (tmp != 0);
if (value < 0) {
--d;
*d = '-';
}
int len = std::end(buffer) - d;
if (dest.rdbuf()->sputn(d, len) != len) {
dest.setstate(std::ios_base::badbit);
}
}
return dest;
}
// vector<T>
template <typename T>
istream &operator>>(istream &is, vector<T> &A) {
for (auto &a : A) is >> a;
return is;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &A) {
for (size_t i = 0; i < A.size(); i++) {
os << A[i];
if (i != A.size() - 1) os << ' ';
}
return os;
}
// vector<vector<T>>
template <typename T>
istream &operator>>(istream &is, vector<vector<T>> &A) {
for (auto &a : A) is >> a;
return is;
}
template <typename T>
ostream &operator<<(ostream &os, vector<vector<T>> &A) {
for (size_t i = 0; i < A.size(); i++) {
os << A[i];
if (i != A.size() - 1) os << endl;
}
return os;
}
// pair<S, T>
template <typename S, typename T>
istream &operator>>(istream &is, pair<S, T> &A) {
is >> A.first >> A.second;
return is;
}
template <typename S, typename T>
ostream &operator<<(ostream &os, pair<S, T> &A) {
os << A.first << ' ' << A.second;
return os;
}
// vector<pair<S, T>>
template <typename S, typename T>
istream &operator>>(istream &is, vector<pair<S, T>> &A) {
for (size_t i = 0; i < A.size(); i++) {
is >> A[i];
}
return is;
}
template <typename S, typename T>
ostream &operator<<(ostream &os, vector<pair<S, T>> &A) {
for (size_t i = 0; i < A.size(); i++) {
os << A[i];
if (i != A.size() - 1) os << endl;
}
return os;
}
// tuple
template <typename T, size_t N>
struct TuplePrint {
static ostream &print(ostream &os, const T &t) {
TuplePrint<T, N - 1>::print(os, t);
os << ' ' << get<N - 1>(t);
return os;
}
};
template <typename T>
struct TuplePrint<T, 1> {
static ostream &print(ostream &os, const T &t) {
os << get<0>(t);
return os;
}
};
template <typename... Args>
ostream &operator<<(ostream &os, const tuple<Args...> &t) {
TuplePrint<decltype(t), sizeof...(Args)>::print(os, t);
return os;
}
// io functions
void FLUSH() {
cout << flush;
}
void print() {
cout << endl;
}
template <class Head, class... Tail>
void print(Head &&head, Tail &&...tail) {
cout << head;
if (sizeof...(Tail)) cout << spa;
print(std::forward<Tail>(tail)...);
}
template <typename T, typename S>
void prisep(vector<T> &A, S sep) {
int n = A.size();
for (int i = 0; i < n; i++) {
cout << A[i];
if (i != n - 1) cout << sep;
}
cout << endl;
}
template <typename T, typename S>
void priend(T A, S end) {
cout << A << end;
}
template <typename T>
void prispa(T A) {
priend(A, spa);
}
template <typename T, typename S>
bool printif(bool f, T A, S B) {
if (f)
print(A);
else
print(B);
return f;
}
template <class... T>
void inp(T &...a) {
(cin >> ... >> a);
}
} // namespace io
using namespace io;
// read graph
vector<vector<int>> read_edges(int n, int m, bool direct = false, int indexed = 1) {
vector<vector<int>> edges(n, vector<int>());
for (int i = 0; i < m; i++) {
INT(u, v);
u -= indexed;
v -= indexed;
edges[u].push_back(v);
if (!direct) edges[v].push_back(u);
}
return edges;
}
vector<vector<int>> read_tree(int n, int indexed = 1) {
return read_edges(n, n - 1, false, indexed);
}
template <typename T = long long>
vector<vector<pair<int, T>>> read_wedges(int n, int m, bool direct = false, int indexed = 1) {
vector<vector<pair<int, T>>> edges(n, vector<pair<int, T>>());
for (int i = 0; i < m; i++) {
INT(u, v);
T w;
inp(w);
u -= indexed;
v -= indexed;
edges[u].push_back({v, w});
if (!direct) edges[v].push_back({u, w});
}
return edges;
}
template <typename T = long long>
vector<vector<pair<int, T>>> read_wtree(int n, int indexed = 1) {
return read_wedges<T>(n, n - 1, false, indexed);
}
// yes / no
namespace yesno {
// yes
inline bool yes(bool f = true) {
cout << (f ? "yes" : "no") << endl;
return f;
}
inline bool Yes(bool f = true) {
cout << (f ? "Yes" : "No") << endl;
return f;
}
inline bool YES(bool f = true) {
cout << (f ? "YES" : "NO") << endl;
return f;
}
// no
inline bool no(bool f = true) {
cout << (!f ? "yes" : "no") << endl;
return f;
}
inline bool No(bool f = true) {
cout << (!f ? "Yes" : "No") << endl;
return f;
}
inline bool NO(bool f = true) {
cout << (!f ? "YES" : "NO") << endl;
return f;
}
// possible
inline bool possible(bool f = true) {
cout << (f ? "possible" : "impossible") << endl;
return f;
}
inline bool Possible(bool f = true) {
cout << (f ? "Possible" : "Impossible") << endl;
return f;
}
inline bool POSSIBLE(bool f = true) {
cout << (f ? "POSSIBLE" : "IMPOSSIBLE") << endl;
return f;
}
// impossible
inline bool impossible(bool f = true) {
cout << (!f ? "possible" : "impossible") << endl;
return f;
}
inline bool Impossible(bool f = true) {
cout << (!f ? "Possible" : "Impossible") << endl;
return f;
}
inline bool IMPOSSIBLE(bool f = true) {
cout << (!f ? "POSSIBLE" : "IMPOSSIBLE") << endl;
return f;
}
// Alice Bob
inline bool Alice(bool f = true) {
cout << (f ? "Alice" : "Bob") << endl;
return f;
}
inline bool Bob(bool f = true) {
cout << (f ? "Bob" : "Alice") << endl;
return f;
}
// Takahashi Aoki
inline bool Takahashi(bool f = true) {
cout << (f ? "Takahashi" : "Aoki") << endl;
return f;
}
inline bool Aoki(bool f = true) {
cout << (f ? "Aoki" : "Takahashi") << endl;
return f;
}
} // namespace yesno
using namespace yesno;
} // namespace templates
using namespace templates;
template <typename T = char>
struct RollingHash {
using u64 = uint64_t;
using u128 = __uint128_t;
int n;
u64 base;
const u64 MOD = (1ull << 61ull) - 1;
std::vector<u64> pw, h;
RollingHash(const std::vector<T> &S, u64 base) : base(base) {
n = S.size();
pw.assign(n + 1, 1ull);
h.assign(n + 1, 0ull);
for (int i = 0; i < n; i++) {
pw[i + 1] = Mul(pw[i], base);
h[i + 1] = Add(Mul(h[i], base), S[i]);
}
}
RollingHash(const std::string &S, u64 base) : base(base) {
n = S.size();
pw.assign(n + 1, 1ull);
h.assign(n + 1, 0ull);
for (int i = 0; i < n; i++) {
pw[i + 1] = Mul(pw[i], base);
h[i + 1] = Add(Mul(h[i], base), S[i]);
}
}
u64 get(int l, int r) {
return Add(h[r], MOD - Mul(h[l], pw[r - l]));
}
u64 Mul(u64 a, u64 b) {
u128 c = (u128)a * b;
return Add(c >> 61, c & MOD);
}
u64 Add(u64 a, u64 b) {
a += b;
if (a >= MOD) a -= MOD;
return a;
}
};
void solve() {
LL(n, p);
VEC(ll, C, n);
ll tot = 0;
fori(i, 1, n + 1) {
ll c = C[i - 1];
ll d = (p - tot + i - 1) / i;
if (c > d) {
print(i - 1);
return;
}
tot += c;
}
print(n);
}
int main() {
#ifndef INTERACTIVE
cin.tie(0)->sync_with_stdio(0);
#endif
// cout << fixed << setprecision(12);
int t;
t = 1;
// cin >> t;
while (t--) solve();
return 0;
}
// // #pragma GCC target("avx2")
// // #pragma GCC optimize("O3")
// // #pragma GCC optimize("unroll-loops")
// // #define INTERACTIVE
//
// #include "kyopro-cpp/template.hpp"
// #include "string/safetyRollingHash.hpp"
//
// void solve() {
// LL(n, p);
// VEC(ll, C, n);
// ll tot = 0;
// fori(i, 1, n + 1) {
// ll c = C[i - 1];
//
// ll d = (p - tot + i - 1) / i;
// if (c > d) {
// print(i - 1);
// return;
// }
// tot += c;
// }
// print(n);
// }
//
// int main() {
// #ifndef INTERACTIVE
// cin.tie(0)->sync_with_stdio(0);
// #endif
// // cout << fixed << setprecision(12);
// int t;
// t = 1;
// // cin >> t;
// while (t--) solve();
// return 0;
// }
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3876kb
input:
5 15 1 2 3 4 5
output:
3
result:
ok single line: '3'
Test #2:
score: 0
Accepted
time: 4ms
memory: 3916kb
input:
100000 559309580160692839 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
84437
result:
ok single line: '84437'
Test #3:
score: 0
Accepted
time: 4ms
memory: 3852kb
input:
100000 890934113082207108 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
53636
result:
ok single line: '53636'
Test #4:
score: 0
Accepted
time: 4ms
memory: 3860kb
input:
100000 132839930703581978 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
59360
result:
ok single line: '59360'
Test #5:
score: 0
Accepted
time: 4ms
memory: 3836kb
input:
100000 761263352659137865 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
67748
result:
ok single line: '67748'
Test #6:
score: 0
Accepted
time: 3ms
memory: 3844kb
input:
100000 654001515423941861 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
25745
result:
ok single line: '25745'
Test #7:
score: 0
Accepted
time: 3ms
memory: 3932kb
input:
100000 755568812034403272 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
40873
result:
ok single line: '40873'
Test #8:
score: 0
Accepted
time: 3ms
memory: 4056kb
input:
100000 783129347604694200 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
44527
result:
ok single line: '44527'
Test #9:
score: 0
Accepted
time: 3ms
memory: 3936kb
input:
100000 905120603799436149 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
58851
result:
ok single line: '58851'
Test #10:
score: 0
Accepted
time: 3ms
memory: 4076kb
input:
100000 240004036785370527 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
42660
result:
ok single line: '42660'
Test #11:
score: 0
Accepted
time: 4ms
memory: 4076kb
input:
100000 548919634536408821 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
30657
result:
ok single line: '30657'
Test #12:
score: 0
Accepted
time: 7ms
memory: 3940kb
input:
100000 75636237219086009 1 37818118609543001 12606039536514334 6303019768257167 3781811860954300 2521207907302866 1800862790930619 1350647093197964 1050503294709528 840402635767622 687602156537145 573001797114288 484847674481320 415583720983989 360172558186124 315150988412858 278074401540757 2471772...
output:
100000
result:
ok single line: '100000'
Test #13:
score: 0
Accepted
time: 3ms
memory: 3852kb
input:
100000 236447379349717830 1 118223689674858912 39407896558286304 19703948279143152 11822368967485891 7881579311657261 5629699508326615 4222274631244961 3283991379857192 2627193103885753 2149521630451980 1791268025376650 1515688329164858 1299161424998449 1125939901665323 985197413957157 8692918358445...
output:
100000
result:
ok single line: '100000'
Test #14:
score: 0
Accepted
time: 7ms
memory: 3852kb
input:
100000 238284828602599618 1 119142414301299807 39714138100433269 19857069050216634 11914241430129980 7942827620086654 5673448300061895 4255086225046421 3309511508369439 2647609206695551 2166225714569087 1805188095474239 1527466850016664 1309257300014283 1134689660012379 992853452510832 8760471639801...
output:
100000
result:
ok single line: '100000'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3888kb
input:
100000 209481399482344513 1 104740699741172255 34913566580390751 17456783290195376 10474069974117225 6982713316078150 4987652368627250 3740739276470437 2909463881699229 2327571105359383 1904376358930404 1586980299108670 1342829483861183 1150996700452442 997530473725450 872839164509769 77015220397920...
output:
100000
result:
ok single line: '100000'
Test #16:
score: 0
Accepted
time: 7ms
memory: 4008kb
input:
100000 160284526594608875 1 80142263297304436 26714087765768145 13357043882884073 8014226329730443 5342817553153629 3816298252252592 2862223689189444 2226173980480679 1780939184384543 1457132059950989 1214276716625825 1027464914068005 880684212058290 763259650450518 667852194144203 589281347774297 5...
output:
100000
result:
ok single line: '100000'
Test #17:
score: 0
Accepted
time: 7ms
memory: 3904kb
input:
100000 852095496567419553 1 426047748283709776 142015916094569925 71007958047284962 42604774828370977 28403183218913985 20287988013509989 15215991010132492 11834659674547494 9467727739637995 7746322696067450 6455268913389542 5462150619021920 4681843387733074 4057597602701998 3550397902364248 3132704...
output:
100000
result:
ok single line: '100000'
Test #18:
score: 0
Accepted
time: 8ms
memory: 4012kb
input:
100000 787884515487196686 1 393942257743598343 131314085914532781 65657042957266390 39394225774359834 26262817182906556 18759155130647540 14069366347985655 10942840492877731 8754272394302185 7162586504429061 5968822087024217 5050541765943568 4329035799380201 3751831026129508 3282852147863319 2896634...
output:
100000
result:
ok single line: '100000'
Test #19:
score: 0
Accepted
time: 3ms
memory: 3884kb
input:
100000 705443926439369243 1 352721963219684622 117573987739894874 58786993869947437 35272196321968462 23514797547978974 16796283962842125 12597212972131593 9797832311657906 7838265849326325 6413126603994266 5344272169995221 4522076451534418 3876065529886644 3359256792568425 2939349693497372 25935438...
output:
1
result:
ok single line: '1'
Test #20:
score: 0
Accepted
time: 7ms
memory: 4052kb
input:
100000 400695253982082795 1 200347626991041398 66782542330347133 33391271165173566 20034762699104140 13356508466069426 9540363190049590 7155272392537193 5565211860862261 4452169488689809 3642684127109843 3035570105924869 2568559320397966 2201622274626828 1908072638009918 1669563558258678 14731443161...
output:
1
result:
ok single line: '1'
Test #21:
score: 0
Accepted
time: 7ms
memory: 4072kb
input:
100000 954649278647157019 1 477324639323578511 159108213107859503 79554106553929752 47732463932357851 31821642621571900 22729744729694215 17047308547270661 13259017758988292 10607214207190633 8678629805883245 7232191504902704 6119546657994596 5245325706852511 4545948945938843 3977705327696487 350973...
output:
1
result:
ok single line: '1'
Test #22:
score: 0
Accepted
time: 7ms
memory: 3940kb
input:
100000 827879037502813038 1 413939518751406518 137979839583802173 68989919791901086 41393951875140652 27595967916760434 19711405654828882 14783554241121661 11498319965316847 9198655972253478 7526173068207391 6271810890172826 5306916907069314 4548785920345126 3942281130965776 3449495989595054 3043672...
output:
214
result:
ok single line: '214'
Test #23:
score: 0
Accepted
time: 7ms
memory: 4056kb
input:
100000 547920341258674169 1 273960170629337084 91320056876445694 45660028438222847 27396017062933708 18264011375289139 13045722410920813 9784291808190610 7610004739703808 6088003791763046 4981094011442492 4150911676202077 3512309879863296 3010551325597111 2609144482184162 2283001421911142 2014413019...
output:
74
result:
ok single line: '74'
Test #24:
score: 0
Accepted
time: 7ms
memory: 3864kb
input:
100000 859719130041796908 1 429859565020898453 143286521673632818 71643260836816409 42985956502089845 28657304334726563 20469503096233259 15352127322174945 11940543472802735 9552434778242188 7815628454925426 6513023712437855 5511020064370493 4723731483746137 4093900619246652 3582163041840820 3160732...
output:
322
result:
ok single line: '322'
Test #25:
score: 0
Accepted
time: 7ms
memory: 3904kb
input:
100000 771358528927320765 1 385679264463660382 128559754821220127 64279877410610063 38567926446366038 25711950964244025 18365679260174304 13774259445130728 10713312901768344 8570650321414675 7012350262975643 5843625219146369 4944605954662312 4238233675424839 3673135852034861 3213993870530503 2835876...
output:
54
result:
ok single line: '54'
Test #26:
score: 0
Accepted
time: 7ms
memory: 3924kb
input:
100000 301578483639376708 1 150789241819688353 50263080606562784 25131540303281392 15078924181968835 10052616121312557 7180440086651826 5385330064988870 4188590050546898 3350872040437519 2741622578539788 2284685482116490 1933195407944722 1657024635381190 1436088017330365 1256577015164069 11087444251...
output:
381
result:
ok single line: '381'