QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#283158 | #5684. 拧螺丝 | qkm66666 | AC ✓ | 1790ms | 4188kb | C++17 | 20.3kb | 2023-12-13 23:04:16 | 2023-12-13 23:04:17 |
Judging History
answer
#ifndef __DECIMAL_HEADER_INCLUDED__
#define __DECIMAL_HEADER_INCLUDED__
#include <cstdlib>
#include <cstring>
#include <climits>
#include <string>
#include <vector>
using std::string;
typedef std::vector <int> vector;
class Decimal {
public:
static const int BASE = 1000000000;
static const long long BASE2 = (long long)BASE * BASE;
Decimal ();
Decimal (const string &s);
Decimal (const char *s);
Decimal (int x);
Decimal (long long x);
Decimal (const Decimal &b);
Decimal (const vector &digits, bool is_negative = false);
bool is_zero() const;
string to_string() const;
int to_int() const;
long long to_long_long() const;
int compare_with(const Decimal &b) const;
int compare_with(int x) const;
int compare_with(long long x) const;
Decimal & operator = (const string &s);
Decimal & operator = (const char *s);
Decimal & operator = (int x);
Decimal & operator = (long long x);
Decimal & operator = (const Decimal &b);
friend Decimal operator + (const Decimal &a, const Decimal &b);
friend Decimal operator + (const Decimal &a, int x);
friend Decimal operator + (int x, const Decimal &a);
friend Decimal operator + (const Decimal &a, long long x);
friend Decimal operator + (long long x, const Decimal &a);
friend Decimal operator - (const Decimal &a, const Decimal &b);
friend Decimal operator - (const Decimal &a, int x);
friend Decimal operator - (int x, const Decimal &a);
friend Decimal operator - (const Decimal &a, long long x);
friend Decimal operator - (long long x, const Decimal &a);
friend Decimal operator * (const Decimal &a, const Decimal &b);
friend Decimal operator * (const Decimal &a, int x);
friend Decimal operator * (int x, const Decimal &a);
friend Decimal operator / (const Decimal &a, const Decimal &b);
friend Decimal operator / (const Decimal &a, int x);
friend Decimal operator % (const Decimal &a, const Decimal &b);
friend Decimal operator % (const Decimal &a, int x);
friend bool operator < (const Decimal &a, const Decimal &b);
friend bool operator < (const Decimal &a, int x);
friend bool operator < (int x, const Decimal &b);
friend bool operator < (const Decimal &a, long long x);
friend bool operator < (long long x, const Decimal &b);
friend bool operator > (const Decimal &a, const Decimal &b);
friend bool operator > (const Decimal &a, int x);
friend bool operator > (int x, const Decimal &b);
friend bool operator > (const Decimal &a, long long x);
friend bool operator > (long long x, const Decimal &b);
friend bool operator <= (const Decimal &a, const Decimal &b);
friend bool operator <= (const Decimal &a, int x);
friend bool operator <= (int x, const Decimal &b);
friend bool operator <= (const Decimal &a, long long x);
friend bool operator <= (long long x, const Decimal &b);
friend bool operator >= (const Decimal &a, const Decimal &b);
friend bool operator >= (const Decimal &a, int x);
friend bool operator >= (int x, const Decimal &b);
friend bool operator >= (const Decimal &a, long long x);
friend bool operator >= (long long x, const Decimal &b);
friend bool operator == (const Decimal &a, const Decimal &b);
friend bool operator == (const Decimal &a, int x);
friend bool operator == (int x, const Decimal &b);
friend bool operator == (const Decimal &a, long long x);
friend bool operator == (long long x, const Decimal &b);
friend bool operator != (const Decimal &a, const Decimal &b);
friend bool operator != (const Decimal &a, int x);
friend bool operator != (int x, const Decimal &b);
friend bool operator != (const Decimal &a, long long x);
friend bool operator != (long long x, const Decimal &b);
Decimal & operator += (int x);
Decimal & operator += (long long x);
Decimal & operator += (const Decimal &b);
Decimal & operator -= (int x);
Decimal & operator -= (long long x);
Decimal & operator -= (const Decimal &b);
Decimal & operator *= (int x);
Decimal & operator *= (const Decimal &b);
Decimal & operator /= (int x);
Decimal & operator /= (const Decimal &b);
Decimal & operator %= (int x);
Decimal & operator %= (const Decimal &b);
Decimal & abs();
Decimal & neg();
friend Decimal operator - (const Decimal &a);
friend std::istream & operator >> (std::istream &in, Decimal &b);
friend std::ostream & operator << (std::ostream &out, const Decimal &b);
explicit operator int () {return this->to_int();}
explicit operator long long () {return this->to_long_long();}
operator void* () {return this->is_zero() ? 0 : this;}
private:
static void append_to_string(std::string &s, long long x);
bool is_neg;
vector s;
void init();
void initstr(const char *str);
Decimal & canonicity();
friend int __builtin_simple_division(const Decimal &a, const Decimal &b);
};
void Decimal::init() {is_neg = false, s.clear(), s.push_back(0);}
void Decimal::initstr(const char *str) {
this->init();
int L = strlen(str);
if (*str == 45) is_neg = true, ++str, --L;
if (!L || (L == 1 && *str == 48)) {is_neg = false; return;}
int i; char tok[10]; tok[9] = 0;
s.clear();
for (i = 1; i * 9 <= L; ++i) {
memcpy(tok, str + (L - i * 9), 9);
s.push_back((int)strtol(tok, NULL, 10));
}
if (L % 9) {
memcpy(tok, str, L % 9), tok[L % 9] = 0;
s.push_back((int)strtol(tok, NULL, 10));
}
this->canonicity();
}
Decimal & Decimal::canonicity() {
for (; s.size() > 1 && !s.back(); s.pop_back());
if (this->is_zero()) is_neg = false;
return *this;
}
Decimal::Decimal () {this->init();}
Decimal::Decimal (const string &s) {this->initstr(s.c_str());}
Decimal::Decimal (const char *s) {this->initstr(s);}
Decimal::Decimal (int x) {
this->init(), x < 0 && (is_neg = true, x = -x), s.back() = x % BASE;
if (x >= BASE) s.push_back(x / BASE);
}
Decimal::Decimal (long long x) {
this->init(), x < 0 && (is_neg = true, x = -x), s.back() = x % BASE;
if (x >= BASE) s.push_back(x / BASE % BASE);
if (x >= BASE2) s.push_back(x / BASE2);
}
Decimal::Decimal (const Decimal &b) {is_neg = b.is_neg, s = b.s;}
Decimal::Decimal (const vector &digits, bool is_negative) {is_neg = is_negative, s = digits, this->canonicity();}
bool Decimal::is_zero() const {return s.size() == 1 && s.back() == 0;}
string Decimal::to_string() const {
string ret;
if (is_neg && !this->is_zero()) ret.push_back(45);
int i = (int)s.size() - 1; char tok[10];
for (sprintf(tok, "%d", s[i]); ret += tok, i--; sprintf(tok, "%09d", s[i]));
return ret;
}
int Decimal::to_int() const {
long long v = this->to_long_long();
return v >= INT_MAX ? INT_MAX : v <= INT_MIN ? INT_MIN : (int)v;
}
long long Decimal::to_long_long() const {
unsigned long long v = 0;
switch (s.size()) {
case 3u : if (s[2] > 9) return is_neg ? LLONG_MIN : LLONG_MAX; v += s[2] * BASE2;
case 2u : v += (long long)s[1] * BASE;
case 1u : v += s[0]; break;
default : return is_neg ? LLONG_MIN : LLONG_MAX;
}
return is_neg ? (v > LLONG_MAX ? LLONG_MIN : -(long long)v) : (v >= LLONG_MAX ? (long long)LLONG_MAX : (long long)v);
}
int Decimal::compare_with(const Decimal &b) const {
if (is_neg != b.is_neg) return is_neg;
if (s.size() != b.s.size()) return (s.size() < b.s.size()) ^ is_neg ? -1 : 1;
for (int i = (int)s.size() - 1; i >= 0; --i)
if (s[i] != b.s[i]) return (s[i] < b.s[i]) ^ is_neg ? -1 : 1;
return 0;
}
int Decimal::compare_with(int x) const {return this->compare_with((long long)x);}
int Decimal::compare_with(long long x) const {
long long v = this->to_long_long();
if (x == LLONG_MAX) return v != x ? -1 : this->to_string() != "9223372036854775807";
if (x == LLONG_MIN) return v != x ? 1 : -(this->to_string() != "-9223372036854775808");
return v < x ? -1 : v > x;
}
Decimal & Decimal::operator = (const string &s) {return this->initstr(s.c_str()), *this;}
Decimal & Decimal::operator = (const char *s) {return this->initstr(s), *this;}
Decimal & Decimal::operator = (int x) {
this->init(), x < 0 && (is_neg = true, x = -x), s.back() = x % BASE;
if (x >= BASE) s.push_back(x / BASE);
return *this;
}
Decimal & Decimal::operator = (long long x) {
this->init(), x < 0 && (is_neg = true, x = -x), s.back() = x % BASE;
if (x >= BASE) s.push_back(x / BASE % BASE);
if (x >= BASE2) s.push_back(x / BASE2);
return *this;
}
Decimal & Decimal::operator = (const Decimal &b) {return is_neg = b.is_neg, s = b.s, *this;}
#define __DECIMAL_COMPARATOR__(op, neg) \
bool operator op (const Decimal &a, const Decimal &b) {return a.compare_with(b) op 0;} \
bool operator op (const Decimal &a, int x) {return a.compare_with(x) op 0;} \
bool operator op (int x, const Decimal &b) {return b.compare_with(x) neg 0;} \
bool operator op (const Decimal &a, long long x) {return a.compare_with(x) op 0;} \
bool operator op (long long x, const Decimal &b) {return b.compare_with(x) neg 0;}
__DECIMAL_COMPARATOR__(<, >);
__DECIMAL_COMPARATOR__(>, >);
__DECIMAL_COMPARATOR__(<=, >=);
__DECIMAL_COMPARATOR__(>=, <=);
__DECIMAL_COMPARATOR__(==, ==);
__DECIMAL_COMPARATOR__(!=, !=);
#undef __DECIMAL_COMPARATOR__
Decimal & Decimal::abs() {return is_neg = false, *this;}
Decimal & Decimal::neg() {return is_neg ^= !this->is_zero(), *this;}
Decimal operator - (const Decimal &a) {Decimal ret = a; return ret.neg();}
std::istream & operator >> (std::istream &in, Decimal &b) {string s; return in >> s, b.initstr(s.c_str()), in;}
std::ostream & operator << (std::ostream &out, const Decimal &b) {return out << b.to_string();}
void __builtin_abs_add_long_long(vector &s, long long x) {
if (s.size() < 3u) s.resize(3);
s[0] += x % Decimal::BASE, s[1] += x / Decimal::BASE % Decimal::BASE, s[2] += x / Decimal::BASE2;
int i, n = (int)s.size(); s.push_back(0);
for (i = 0; i < n; ++i) if (s[i] >= Decimal::BASE) s[i + 1] += s[i] / Decimal::BASE, s[i] %= Decimal::BASE;
}
void __builtin_abs_sub_long_long(vector &s, long long x) {
if (s.size() < 3u) s.resize(3);
s[0] -= x % Decimal::BASE, s[1] -= x / Decimal::BASE % Decimal::BASE, s[2] -= x / Decimal::BASE2;
int i, n = (int)s.size(), d;
for (i = 0; i < n - 1; ++i) if (s[i] < 0) s[i + 1] += d = (s[i] + 1) / Decimal::BASE - 1, s[i] -= d * Decimal::BASE;
}
Decimal & Decimal::operator += (int x) {return *this += (long long)x;}
Decimal & Decimal::operator += (long long x) {
if (!x) return *this;
if (x == LLONG_MIN) return *this -= Decimal("9223372036854775808");
if (x < 0) return *this -= -x;
if (!is_neg)
__builtin_abs_add_long_long(s, x);
else
switch (this->compare_with(-x)) {
case -1 : __builtin_abs_sub_long_long(s, x); break;
case 0 : return this->init(), *this;
case 1 : return *this = Decimal(this->to_long_long() + x);
}
return this->canonicity();
}
Decimal & Decimal::operator -= (int x) {return *this -= (long long)x;}
Decimal & Decimal::operator -= (long long x) {
if (!x) return *this;
if (x == LLONG_MIN) return *this += Decimal("9223372036854775808");
if (x < 0) return *this += -x;
if (is_neg)
__builtin_abs_add_long_long(s, x);
else
switch (this->compare_with(x)) {
case -1 : return *this = Decimal(this->to_long_long() - x);
case 0 : return this->init(), *this;
case 1 : __builtin_abs_sub_long_long(s, x); break;
}
return this->canonicity();
}
Decimal & Decimal::operator *= (int x) {
if (!x || this->is_zero()) return this->init(), *this;
if (x < 0) is_neg ^= 1, x = -x;
int i, n = s.size(); long long cur = 0;
s.push_back(0), s.push_back(0);
for (i = 0; i < n + 2; ++i) {
cur = (long long)x * s[i] + cur;
s[i] = cur % BASE, cur /= BASE;
}
return this->canonicity();
}
Decimal & Decimal::operator /= (int x) {
if (this->is_zero()) return *this;
bool neg = is_neg;
if (x < 0) is_neg ^= 1, x = -x;
int i, n = s.size(); long long cur = 0;
for (i = n - 1; i >= 0; --i) {
cur = cur * BASE + s[i];
if (x==2) s[i] = cur >>1;
else if(x==3) s[i]=cur/3;
else if(x==4) s[i]=cur/4;
else s[i]=cur/x;
cur -= (long long)x * s[i];
}
if (neg && cur) __builtin_abs_add_long_long(s, 1ll);
return this->canonicity();
}
Decimal & Decimal::operator %= (int x) {
if (x < 0) x = -x;
int i, n = s.size(); long long cur = 0;
for (i = n - 1; i >= 0; --i) cur = (cur * BASE + s[i]) % x;
if (this->is_neg) cur = (cur ? x - cur : 0);
return *this = Decimal((int)cur);
}
Decimal operator + (const Decimal &a, int x) {Decimal ret = a; return ret += x;}
Decimal operator + (int x, const Decimal &a) {Decimal ret = a; return ret += x;}
Decimal operator + (const Decimal &a, long long x) {Decimal ret = a; return ret += x;}
Decimal operator + (long long x, const Decimal &a) {Decimal ret = a; return ret += x;}
Decimal operator - (const Decimal &a, int x) {Decimal ret = a; return ret -= x;}
Decimal operator - (int x, const Decimal &a) {return -(a - x);}
Decimal operator - (const Decimal &a, long long x) {Decimal ret = a; return ret -= x;}
Decimal operator - (long long x, const Decimal &a) {return -(a - x);}
Decimal operator * (const Decimal &a, int x) {Decimal ret = a; return ret *= x;}
Decimal operator * (int x, const Decimal &a) {Decimal ret = a; return ret *= x;}
Decimal operator / (const Decimal &a, int x) {Decimal ret = a; return ret /= x;}
Decimal operator % (const Decimal &a, int x) {Decimal ret = a; return ret %= x;}
Decimal operator + (const Decimal &a, const Decimal &b) {
if (a.is_neg == b.is_neg) {
int i, n = a.s.size(), m = b.s.size(), min, max;
const Decimal &big = (n < m ? (min = n, max = m, b) : (min = m, max = n, a));
Decimal ret; ret.is_neg = a.is_neg, ret.s.resize(max + 1);
for (i = 0; i < min; ++i) {
ret.s[i] += a.s[i] + b.s[i];
if (ret.s[i] >= Decimal::BASE) ret.s[i] -= Decimal::BASE, ++ret.s[i + 1];
}
for (; i < max; ++i) {
ret.s[i] += big.s[i];
if (ret.s[i] >= Decimal::BASE) ret.s[i] -= Decimal::BASE, ++ret.s[i + 1];
}
return ret.canonicity();
} else return a.is_neg ? b - -a : a - -b;
}
Decimal operator - (const Decimal &a, const Decimal &b) {
if (!a.is_neg && !b.is_neg)
switch (a.compare_with(b)) {
case -1 : return -(b - a);
case 0 : return Decimal();
default : {
int i, n = a.s.size(), m = b.s.size();
Decimal ret = a;
for (i = 0; i < n; ++i) {
i < m ? ret.s[i] -= b.s[i] : 0;
if (ret.s[i] < 0) ret.s[i] += Decimal::BASE, --ret.s[i + 1];
}
return ret.canonicity();
}
}
else if (a.is_neg && b.is_neg) return -b - -a;
else return a.is_neg ? -(-a + b) : a + -b;
}
Decimal operator * (const Decimal &a, const Decimal &b) {
if (a.is_zero() || b.is_zero()) return Decimal();
int i, j, k, n = a.s.size(), m = b.s.size(); long long cur = 0, carry = 0;
Decimal ret; ret.is_neg = a.is_neg ^ b.is_neg, ret.s.resize(n + m);
for (k = 0; k < n + m; ++k) {
for (k < m ? (i = 0, j = k) : (i = k - m + 1, j = m - 1); i < n && j >= 0; ++i, --j)
cur = (cur + (long long)a.s[i] * b.s[j]), carry += cur / Decimal::BASE, cur %= Decimal::BASE;
ret.s[k] = (int)cur, cur = carry % Decimal::BASE, carry /= Decimal::BASE;
}
return ret.canonicity();
}
int __builtin_simple_division(const Decimal &a, const Decimal &b) {
switch (a.compare_with(b)) {
case -1 : return 0;
case 0 : return 1;
}
int n = a.s.size(), m = b.s.size(), guess_quo; long long B;
if (m == 1) return a.to_long_long() / b.s.back();
B = (long long)b.s.back() * Decimal::BASE + b.s[m - 2];
if (n == m + 1)
#ifdef _GLIBCXX_USE_INT128
guess_quo = (((__int128)a.s.back() * Decimal::BASE + a.s[n - 2]) * Decimal::BASE + a.s[n - 3] + 1) / B;
#else
guess_quo = (((long double)a.s.back() * Decimal::BASE + a.s[n - 2]) * Decimal::BASE + a.s[n - 3] + 1) / B, guess_quo += 2;
#endif
else
guess_quo = ((long long)a.s.back() * Decimal::BASE + a.s[n - 2] + 1) / B;
// fprintf(stderr, " ... Guess Quotient = %d\n", guess_quo);
for (; a < b * guess_quo; --guess_quo);
// fprintf(stderr, " ... Final Quotient = %d\n", guess_quo);
return guess_quo;
}
Decimal operator / (const Decimal &a, const Decimal &b) {
if (a.is_zero() || b.is_zero()) return a;
bool neg = a.is_neg;
int i, n = a.s.size();
Decimal cur, ret, B = b; ret.is_neg = a.is_neg ^ b.is_neg, ret.s.resize(n); B.abs();
for (i = n - 1; i >= 0; --i) {
cur = cur * Decimal::BASE + a.s[i];
ret.s[i] = __builtin_simple_division(cur, B); cur -= B * ret.s[i];
}
if (neg && !cur.is_zero()) __builtin_abs_add_long_long(ret.s, 1ll);
return ret.canonicity();
}
Decimal operator % (const Decimal &a, const Decimal &b) {return a - a / b * b;}
Decimal & Decimal::operator += (const Decimal &b) {return *this = *this + b;}
Decimal & Decimal::operator -= (const Decimal &b) {return *this = *this - b;}
Decimal & Decimal::operator *= (const Decimal &b) {return *this = *this * b;}
Decimal & Decimal::operator /= (const Decimal &b) {return *this = *this / b;}
Decimal & Decimal::operator %= (const Decimal &b) {return *this = *this % b;}
#endif
#include<algorithm>
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<cassert>
#include<cstdio>
#include<cctype>
#include<vector>
#include<bitset>
#include<random>
#include<ctime>
#include<queue>
#include<cmath>
#include<list>
#include<map>
#include<set>
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define pll pair<long long,long long>
#define FF fflush(stdout)
#define inf 0x3f3f3f3f
#define endl "\n"
#define fi first
#define se second
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
//char buf[1<<20],*p1,*p2;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<20,stdin),p1==p2)?EOF:*p1++)
inline int read()
{
int s=0,f=1;
char x=getchar();
while(!isdigit(x))f=(x=='-'?-1:1),x=getchar();
while(isdigit(x))s=s*10+x-'0',x=getchar();
return s*f;
}
const int p=1e9+7;
//ll ksm(int a,int b){ll ans=1,bs=a;while(b){if(b&1)ans=ans*bs%p;bs=bs*bs%p;b>>=1;}return ans;}
mt19937 rd(time(0));
#define reaD read
int n;
int k;
Decimal solve(int n,Decimal c1,Decimal c2)
{
while(1)
{
if(n<=0)return c1+c2-1;
if(k>=c2&&k>=c1+c2)
{
int tim=k/(int)((int)c1+(int)c2);
n-=tim;
int kk=k-tim*(int)((int)c1+(int)c2);
if(kk>=c2)
{
n-=1;
kk-=(int)c2;
c2+=(int)c1-kk+1;
c1=kk;
}
else
{
c2-=kk-1;
c1+=kk;
}
continue;
// return solve(n,c1,c2+1);
}
Decimal a=(c2-1+k-2)/(k-1);
int lf=(int)(a*k-c2-a+1);
n-=1;
c2+=c1+a-lf;
c1=lf;
}
}
int main()
{
n=read(),k=reaD();
if(k==1)
{
if(n==1)puts("1");
else puts("Poor E.S.!");
return 0;
}
if(k==2)
{
Decimal ans=1;
for(int i=1;i<=n-2;i++)
ans=ans*2;
cout<<ans;
return 0;
}
cout<<solve(n,0,1);
//system("pause");
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 383ms
memory: 4028kb
input:
100000 2
output:
249750523253596126986008191082508397745107284763545422942882318465786458116064337081871832833112412600791098611388963732504699915191404414072711783856187321879972240746841777331158760684327811981645006963281027218427140132180709754114217275671266898087947867426321441117420038120808636888581257319663...
result:
ok single line: '249750523253596126986008191082...2100649256288826183597470777344'
Test #2:
score: 0
Accepted
time: 381ms
memory: 4036kb
input:
99999 2
output:
124875261626798063493004095541254198872553642381772711471441159232893229058032168540935916416556206300395549305694481866252349957595702207036355891928093660939986120373420888665579380342163905990822503481640513609213570066090354877057108637835633449043973933713160720558710019060404318444290628659831...
result:
ok single line: '124875261626798063493004095541...1050324628144413091798735388672'
Test #3:
score: 0
Accepted
time: 383ms
memory: 4040kb
input:
99998 2
output:
624376308133990317465020477706270994362768211908863557357205796164466145290160842704679582082781031501977746528472409331261749787978511035181779459640468304699930601867104443327896901710819529954112517408202568046067850330451774385285543189178167245219869668565803602793550095302021592221453143299157...
result:
ok single line: '624376308133990317465020477706...0525162314072206545899367694336'
Test #4:
score: 0
Accepted
time: 384ms
memory: 4032kb
input:
99997 2
output:
312188154066995158732510238853135497181384105954431778678602898082233072645080421352339791041390515750988873264236204665630874893989255517590889729820234152349965300933552221663948450855409764977056258704101284023033925165225887192642771594589083622609934834282901801396775047651010796110726571649578...
result:
ok single line: '312188154066995158732510238853...5262581157036103272949683847168'
Test #5:
score: 0
Accepted
time: 384ms
memory: 3924kb
input:
99996 2
output:
156094077033497579366255119426567748590692052977215889339301449041116536322540210676169895520695257875494436632118102332815437446994627758795444864910117076174982650466776110831974225427704882488528129352050642011516962582612943596321385797294541811304967417141450900698387523825505398055363285824789...
result:
ok single line: '156094077033497579366255119426...7631290578518051636474841923584'
Test #6:
score: 0
Accepted
time: 386ms
memory: 3920kb
input:
99995 2
output:
780470385167487896831275597132838742953460264886079446696507245205582681612701053380849477603476289377472183160590511664077187234973138793977224324550585380874913252333880554159871127138524412442640646760253210057584812913064717981606928986472709056524837085707254503491937619127526990276816429123946...
result:
ok single line: '780470385167487896831275597132...3815645289259025818237420961792'
Test #7:
score: 0
Accepted
time: 377ms
memory: 3924kb
input:
99994 2
output:
390235192583743948415637798566419371476730132443039723348253622602791340806350526690424738801738144688736091580295255832038593617486569396988612162275292690437456626166940277079935563569262206221320323380126605028792406456532358990803464493236354528262418542853627251745968809563763495138408214561973...
result:
ok single line: '390235192583743948415637798566...6907822644629512909118710480896'
Test #8:
score: 0
Accepted
time: 384ms
memory: 4040kb
input:
99993 2
output:
195117596291871974207818899283209685738365066221519861674126811301395670403175263345212369400869072344368045790147627916019296808743284698494306081137646345218728313083470138539967781784631103110660161690063302514396203228266179495401732246618177264131209271426813625872984404781881747569204107280986...
result:
ok single line: '195117596291871974207818899283...3453911322314756454559355240448'
Test #9:
score: 0
Accepted
time: 385ms
memory: 4104kb
input:
99992 2
output:
975587981459359871039094496416048428691825331107599308370634056506978352015876316726061847004345361721840228950738139580096484043716423492471530405688231726093641565417350692699838908923155515553300808450316512571981016141330897477008661233090886320656046357134068129364922023909408737846020536404933...
result:
ok single line: '975587981459359871039094496416...6726955661157378227279677620224'
Test #10:
score: 0
Accepted
time: 383ms
memory: 3924kb
input:
99991 2
output:
487793990729679935519547248208024214345912665553799654185317028253489176007938158363030923502172680860920114475369069790048242021858211746235765202844115863046820782708675346349919454461577757776650404225158256285990508070665448738504330616545443160328023178567034064682461011954704368923010268202466...
result:
ok single line: '487793990729679935519547248208...8363477830578689113639838810112'
Test #11:
score: 0
Accepted
time: 1790ms
memory: 4068kb
input:
100000 3
output:
481744012938087671132213505128057046406281559023946274468802198392958989166704404877864236346099540207898462023537000547118541800341369445605867046320869961430429053568962424713840690059735530926162253638457112980895270841328262411915507257972109391445985189738955832919846103808012024399947442721290...
result:
ok single line: '481744012938087671132213505128...0867320340107434725688507591169'
Test #12:
score: 0
Accepted
time: 1784ms
memory: 4068kb
input:
99999 3
output:
321162675292058447421475670085371364270854372682630849645868132261972659444469603251909490897399693471932308015691333698079027866894246297070578030880579974286952702379308283142560460039823687284108169092304741987263513894218841607943671505314739594297323459825970555279897402538674682933298295147526...
result:
ok single line: '321162675292058447421475670085...7244880226738289817125671727446'
Test #13:
score: 0
Accepted
time: 1784ms
memory: 4124kb
input:
99998 3
output:
214108450194705631614317113390247576180569581788420566430578754841315106296313068834606327264933128981288205343794222465386018577929497531380385353920386649524635134919538855428373640026549124856072112728203161324842342596145894405295781003543159729531548973217313703519931601692449788622198863431684...
result:
ok single line: '214108450194705631614317113390...4829920151158859878083781151631'
Test #14:
score: 0
Accepted
time: 1776ms
memory: 3996kb
input:
99997 3
output:
142738966796470421076211408926831717453713054525613710953719169894210070864208712556404218176622085987525470229196148310257345718619665020920256902613591099683090089946359236952249093351032749904048075152135440883228228397430596270197187335695439819687699315478209135679954401128299859081465908954456...
result:
ok single line: '142738966796470421076211408926...3219946767439239918722520767754'
Test #15:
score: 0
Accepted
time: 1775ms
memory: 4008kb
input:
99996 3
output:
951593111976469473841409392845544783024753696837424739691461132628067139094724750376028121177480573250169801527974322068382304790797766806135046017423940664553933932975728246348327289006884999360320501014236272554854855982870641801314582237969598797917995436521394237866362674188665727209772726363041...
result:
ok single line: '951593111976469473841409392845...2146631178292826612481680511836'
Test #16:
score: 0
Accepted
time: 1780ms
memory: 3976kb
input:
99995 3
output:
634395407984312982560939595230363188683169131224949826460974088418711426063149833584018747451653715500113201018649548045588203193865177870756697344949293776369289288650485497565551526004589999573547000676157515036569903988580427867543054825313065865278663624347596158577575116125777151473181817575361...
result:
ok single line: '634395407984312982560939595230...1431087452195217741654453674557'
Test #17:
score: 0
Accepted
time: 1775ms
memory: 4056kb
input:
99994 3
output:
422930271989541988373959730153575459122112754149966550973982725612474284042099889056012498301102477000075467345766365363725468795910118580504464896632862517579526192433656998377034350669726666382364667117438343357713269325720285245028703216875377243519109082898397439051716744083851434315454545050240...
result:
ok single line: '422930271989541988373959730153...4287391634796811827769635783038'
Test #18:
score: 0
Accepted
time: 1788ms
memory: 4004kb
input:
99993 3
output:
281953514659694658915973153435716972748075169433311033982655150408316189361399926037341665534068318000050311563844243575816979197273412387002976597755241678386350794955771332251356233779817777588243111411625562238475512883813523496685802144583584829012739388598931626034477829389234289543636363366827...
result:
ok single line: '281953514659694658915973153435...9524927756531207885179757188692'
Test #19:
score: 0
Accepted
time: 1773ms
memory: 4180kb
input:
99992 3
output:
187969009773129772610648768957144648498716779622207355988436766938877459574266617358227777022712212000033541042562829050544652798182274924668651065170161118924233863303847554834237489186545185058828740941083708158983675255875682331123868096389056552675159592399287750689651886259489526362424242244551...
result:
ok single line: '187969009773129772610648768957...6349951837687471923453171459128'
Test #20:
score: 0
Accepted
time: 1769ms
memory: 4076kb
input:
99991 3
output:
125312673182086515073765845971429765665811186414804903992291177959251639716177744905485184681808141333355694028375219367029768532121516616445767376780107412616155908869231703222824992791030123372552493960722472105989116837250454887415912064259371035116773061599525167126434590839659684241616161496367...
result:
ok single line: '125312673182086515073765845971...7566634558458314615635447639419'
Test #21:
score: 0
Accepted
time: 1403ms
memory: 3980kb
input:
100000 4
output:
291053100015901163497431797556162436379475773267218916871779093066425073731265489541336290721393566985469963073650376909768689454518072612763812554732314341995755720335636442600084866971684191726457433850282399732558599713784059136815744679144311873072044662065826328022124744509784747305325250411186...
result:
ok single line: '291053100015901163497431797556...8856323609646519115661711470715'
Test #22:
score: 0
Accepted
time: 1395ms
memory: 4088kb
input:
99999 4
output:
218289825011925872623073848167121827284606829950414187653834319799818805298449117156002218041045175239102472305237782682326517090888554459572859416049235756496816790251727331950063650228763143794843075387711799799418949785338044352611808509358233904804033496549369746016593558382338560478993937808390...
result:
ok single line: '218289825011925872623073848167...1642242707234889336746283603036'
Test #23:
score: 0
Accepted
time: 1390ms
memory: 4096kb
input:
99998 4
output:
163717368758944404467305386125341370463455122462810640740375739849864103973836837867001663530783881429326854228928337011744887818166415844679644562036926817372612592688795498962547737671572357846132306540783849849564212339003533264458856382018675428603025122412027309512445168786753920359245453356292...
result:
ok single line: '163717368758944404467305386125...8731682030426167002559712702277'
Test #24:
score: 0
Accepted
time: 1388ms
memory: 4092kb
input:
99997 4
output:
122788026569208303350479039594006027847591341847107980555281804887398077980377628400251247648087911071995140671696252758808665863624811883509733421527695113029459444516596624221910803253679268384599229905587887387173159254252649948344142286514006571452268841809020482134333876590065440269434090017219...
result:
ok single line: '122788026569208303350479039594...4048761522819625251919784526708'
Test #25:
score: 0
Accepted
time: 1389ms
memory: 3960kb
input:
99996 4
output:
920910199269062275128592796955045208856935063853309854164613536655485584852832213001884357360659333039963555037721895691064993977186089126323000661457713347720945833874474681664331024402594512884494224291909155403798694406894874612581067148855049285892016313567653616007504074425490802020755675129145...
result:
ok single line: '920910199269062275128592796955...0536571142114718938939838395031'
Test #26:
score: 0
Accepted
time: 1393ms
memory: 4060kb
input:
99995 4
output:
690682649451796706346444597716283906642701297889982390623460152491614188639624159751413268020494499779972666278291421768298745482889566844742250496093285010790709375405856011248248268301945884663370668218931866552849020805171155959435800361641286964419012235175740212005628055819118101515566756346859...
result:
ok single line: '690682649451796706346444597716...2902428356586039204204878796273'
Test #27:
score: 0
Accepted
time: 1396ms
memory: 4064kb
input:
99994 4
output:
518011987088847529759833448287212929982025973417486792967595114368710641479718119813559951015370874834979499708718566326224059112167175133556687872069963758093032031554392008436186201226459413497528001164198899914636765603878366969576850271230965223314259176381805159004221041864338576136675067260144...
result:
ok single line: '518011987088847529759833448287...9676821267439529403153659097205'
Test #28:
score: 0
Accepted
time: 1390ms
memory: 4100kb
input:
99993 4
output:
388508990316635647319875086215409697486519480063115094725696335776532981109788589860169963261528156126234624781538924744668044334125381350167515904052472818569774023665794006327139650919844560123146000873149174935977574202908775227182637703423223917485694382286353869253165781398253932102506300445108...
result:
ok single line: '388508990316635647319875086215...4757615950579647052365244322904'
Test #29:
score: 0
Accepted
time: 1399ms
memory: 3984kb
input:
99992 4
output:
291381742737476735489906314661557273114889610047336321044272251832399735832341442395127472446146117094675968586154193558501033250594036012625636928039354613927330517749345504745354738189883420092359500654861881201983180652181581420386978277567417938114270786714765401939874336048690449076879725333831...
result:
ok single line: '291381742737476735489906314661...3568211962934735289273933242178'
Test #30:
score: 0
Accepted
time: 1401ms
memory: 4092kb
input:
99991 4
output:
218536307053107551617429735996167954836167207535502240783204188874299801874256081796345604334609587821006976439615645168875774937945527009469227696029515960445497888312009128559016053642412565069269625491146410901487385489136186065290233708175563453585703090036074051454905752036517836807659794000373...
result:
ok single line: '218536307053107551617429735996...7676158972201051466955449931633'
Test #31:
score: 0
Accepted
time: 1073ms
memory: 4160kb
input:
100000 5
output:
431246637426864284241202410310865299343914607857911911683210195760611660732879286057651836942767635814998683078326424975811856941772610424629925026764325558053933754778181254892116313852480148215867090887006063002652926221515490488742424447144832844751921876841540937186932454318311303792013524384493...
result:
ok single line: '431246637426864284241202410310...9079978166513942947519921833267'
Test #32:
score: 0
Accepted
time: 1ms
memory: 3680kb
input:
53298 1
output:
Poor E.S.!
result:
ok single line: 'Poor E.S.!'
Test #33:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
1 1
output:
1
result:
ok single line: '1'
Test #34:
score: 0
Accepted
time: 1ms
memory: 3736kb
input:
31476 31476
output:
1
result:
ok single line: '1'
Test #35:
score: 0
Accepted
time: 307ms
memory: 3956kb
input:
59144 8
output:
363294660940838463273515870401997731640500880916442237814670132000061275030961428593323156830762904244192438602613670961260174940909433706609357786523866548033270680767738646166933883965036837243787212877290574943149938212747933868882686149299061030696648940289011954315268701920073057267720293116451...
result:
ok single line: '363294660940838463273515870401...8929392519544012821825634933535'
Test #36:
score: 0
Accepted
time: 68ms
memory: 3740kb
input:
58639 62
output:
694366140426599347159076052926274357288458587047195699049142706195518090189587055605059235938064981957413152963514635565273824902301532990032531224019115224088474457256579553143985432885429151836060700412287504985466990089822535613359838530360340124625281774227977291837677535388188498353562958632690...
result:
ok single line: '694366140426599347159076052926...9842492175567943499346608447485'
Test #37:
score: 0
Accepted
time: 82ms
memory: 3764kb
input:
70989 75
output:
376120140600150940252322467439907692165390612763874037700303182298762234080807776265965935683903992301867081360713755141438098165867685872861057747859861268871369250720641913066441101382386335434648368828510460046889551690213940001177906442674662444818861837224310525957532171756987904610099059566782...
result:
ok single line: '376120140600150940252322467439...3311057211984658393526187919168'
Test #38:
score: 0
Accepted
time: 120ms
memory: 3824kb
input:
54719 20
output:
467776677051540541752220434680015866662768878551079042442214566700324499618080806852613457992368555028224128273813236092097593612644463380229890029814606450277450830903991916546530080983395293418056618838572595077801938890988169023837188333313208150696564574778208167600083177209843828143545930765279...
result:
ok single line: '467776677051540541752220434680...6538285737346325319317061779429'
Test #39:
score: 0
Accepted
time: 127ms
memory: 3780kb
input:
81859 50
output:
920123790990303874309412448767464773074845821880790110670845247212746162676994938671392829334327618135187627941711323992559199706407086198484572069065864559309089404585835931097460151756036652472919114184124679824718962977653787173033366649009014027739619803676590080349814552408099443076416084287758...
result:
ok single line: '920123790990303874309412448767...8106768445561477237185680025827'
Test #40:
score: 0
Accepted
time: 55ms
memory: 3864kb
input:
53023 70
output:
120792778351079278033589181412387534306127023123818540074624314646144279188266742602823667406869625875815699903984678721948348577091587455611520270885805186908372117747364254788998316786840190169408236709608622924630800205036245459944441938279229595130550543029355100437467976422051064059754047740108...
result:
ok single line: '120792778351079278033589181412...7568812547435084670012116660022'
Test #41:
score: 0
Accepted
time: 60ms
memory: 3756kb
input:
56866 73
output:
246934622464800947439023037904128306284079466599302470624212295528001447180504720895254629181019076925564901035119218415172441175103574713795833748356146469741677592850318370236694270547820070498243755814124751317203440765876829591362090556187564701246656945094815708452824655876473079215792230794957...
result:
ok single line: '246934622464800947439023037904...8562858598415577893977613432585'
Test #42:
score: 0
Accepted
time: 98ms
memory: 3804kb
input:
53237 25
output:
363855288077776140545091942288013734998589505856906399098257551688634506876360926723306687973846504843670302678972189262673616506361914004784388976424915115519373000157747230285777132935141377585474602479012124306214833901566541701219391195136588065375908895221478043729960346167255164412534891532761...
result:
ok single line: '363855288077776140545091942288...9061601209618155763722624863986'
Test #43:
score: 0
Accepted
time: 114ms
memory: 3860kb
input:
83091 75
output:
133187654811457887697511444154242709129640477938300898432363875389103197577511275800863694270187527323630842101457878796337725102064424035179081597366340246090493656967453147909666500824748971820321704602463595061592418062061022617320047547332403501467239505646553083640115042739710988470886054233323...
result:
ok single line: '133187654811457887697511444154...6643971202362839440478810119268'
Test #44:
score: 0
Accepted
time: 56ms
memory: 3756kb
input:
54511 73
output:
192874804192916171808317767203415816176382780126232728461976371071688147412225296743382359382716510844649889056016026148747212518555028837209108133573166382597930230426152093212986948579941166945601294969843842247655841707855382980882461988598638642891580986780242019946299274016429423622193802904655...
result:
ok single line: '192874804192916171808317767203...4655371635059125279427409870176'
Test #45:
score: 0
Accepted
time: 193ms
memory: 3992kb
input:
96674 40
output:
506998125025829379617707152940082652785222213600264711189406825133355418302682349728119768795782758750712668779250412975303895466498949070783794325323048117817138959951464801174097030890748818110625745047006127021913807175341140571281449368351356815322980241609309910723417622225607619217908382528606...
result:
ok single line: '506998125025829379617707152940...8212980417603902920676936822066'
Test #46:
score: 0
Accepted
time: 56ms
memory: 3928kb
input:
59053 99
output:
130930559749610059521633566917396636621463233518173296686360111528064666329967724144774058169544180327600983179735587099723182688066475858384671914192820241204346433025298879410253799159676374035073725494782611094873600042952181028609455035713650406842973156421
result:
ok single line: '130930559749610059521633566917...8609455035713650406842973156421'
Test #47:
score: 0
Accepted
time: 63ms
memory: 3740kb
input:
67288 100
output:
277751442190097107277867750374355012760113028015726177841131967092683934663560263137987378958797040200370863723697182311597754191832476053011361490111257560369760189310705945694888072175156124437295607047030529523233541865273215296628404554073981741180441590253654480548576560621941266892481697
result:
ok single line: '277751442190097107277867750374...4480548576560621941266892481697'
Test #48:
score: 0
Accepted
time: 546ms
memory: 4140kb
input:
81165 8
output:
398954539508212865866102399216741886184229847086949789738285323222299304367161307928332886821675131097876800697854891509535618202987568610097936503846328105713569844150389746646577209298465238178734718848481353356910956140455779106812300306602805131496209388430891416862474371754608704701447032820700...
result:
ok single line: '398954539508212865866102399216...8035990640827442386150325700111'
Test #49:
score: 0
Accepted
time: 1510ms
memory: 4188kb
input:
91900 3
output:
220606332643162646750183741246117431285293379019265602367751607055150202573231614698568251817162679746141151239923784578758824378993161702220597866192946023523591687337030769708211303480860173771951922849170778482034039004910994352170427779168210436893242762860836905718174806034578712438708307244998...
result:
ok single line: '220606332643162646750183741246...7303423156034548101428655346281'
Test #50:
score: 0
Accepted
time: 52ms
memory: 3860kb
input:
57710 99
output:
156889664782278577536117315678781963717830777867952735939142608368088117318562354184310156925286993117027632558886025994921777105242724005967388048248837017676190498630582143295010600107718857540442716160080516431180799371280756728305006320313807690941434
result:
ok single line: '156889664782278577536117315678...0756728305006320313807690941434'
Test #51:
score: 0
Accepted
time: 56ms
memory: 3868kb
input:
55687 82
output:
309436907675636622507172420018480014591186167567799842790251008536516838988711260610361891200288245830724667261083912621783852591837756300687674758190316816011092917569544676259930240921562924934924828658339781974843961593216416421983148536287345149374682542340883558592295493403791082266984593370
result:
ok single line: '309436907675636622507172420018...8592295493403791082266984593370'
Test #52:
score: 0
Accepted
time: 107ms
memory: 3764kb
input:
90195 87
output:
393308092486277123593932692279737121904587278929551381081342901510967332528950309634101512090644195930441282077016798931099712420172691200463007641569679395207059024057441800556931747983818240869904261060237522209076916558281240746417236658810757403255442290235200167043352157725640923376799021006476...
result:
ok single line: '393308092486277123593932692279...7250567876312647421874894930782'
Test #53:
score: 0
Accepted
time: 157ms
memory: 3852kb
input:
62448 19
output:
118300742166008875067609183829589612770229837729130126201173290581671524638798579071465905130193155263694300881167065798758824734066832726367820311433258250537240093657908332226001217567195573505571933450262256340057182651593988733530179976551013499716315319900369514921212297648248898915701933710505...
result:
ok single line: '118300742166008875067609183829...6357496364242515142164474957154'
Test #54:
score: 0
Accepted
time: 56ms
memory: 3856kb
input:
53606 70
output:
531102565227353611059975835205583528531101876102209797380748899503609509132704647332236332853238344387201903544119970164425402764967118215914047970890632693253862783335439893995043247617175720492994842748092985991811376390910554217189761039968106999511394047936375391629338306198504263413798563401812...
result:
ok single line: '531102565227353611059975835205...6543348007234870298147265043536'
Test #55:
score: 0
Accepted
time: 80ms
memory: 3872kb
input:
67232 66
output:
338622894747219959159236895845079336328185065043320965913814086174431631550967411610518974354542034683561405712202243503411180391981186075010948461203016278253184970084769249063083931505278310680496151224889461582908860848513084945364669992122362017260478677692309067348124598685199402429889120158889...
result:
ok single line: '338622894747219959159236895845...0850162012150831492724374157723'
Test #56:
score: 0
Accepted
time: 63ms
memory: 3808kb
input:
51616 48
output:
482469285922113887197075101243950992535365786276798575994586566247564441857661263810542286541604241500406990324311954188248269890655209068673609327595209024580086752938322984820997659562469821107978638544069476982098283483281219213299355963263783288209850800760168383760107195696024616199114770628228...
result:
ok single line: '482469285922113887197075101243...0324755902744497654835475749355'
Test #57:
score: 0
Accepted
time: 131ms
memory: 3880kb
input:
90508 61
output:
290878364789036205935396139174457120348783846482476726429634575584961804942982617546665559173637532772125920605072586720371124501603040808771749904109538783833771139263666002310739672721730825940145054948189996264319323838472569788399222091557162978176990235234652795328348194362285978014921048928655...
result:
ok single line: '290878364789036205935396139174...2848741947419017946234336843585'
Test #58:
score: 0
Accepted
time: 135ms
memory: 3768kb
input:
95320 67
output:
184289533578253827991955352753687614528264040123313796500598866701356773292284393924138501960162820161787786293320453187174315310012147259835345848854921009106598411938251933735649732324097493695365253462470362674035153811705986906479048358315009812121522878177243108108735156062995849527957444292105...
result:
ok single line: '184289533578253827991955352753...0373577721596736747610737931498'
Test #59:
score: 0
Accepted
time: 236ms
memory: 3892kb
input:
93823 29
output:
392470249673721133697239949760551693371545091475980102079230759587993104735627989907667337089460367968121065585167592154895155056558660976563157071864086006240285961880316686307489876636952640709734595646722943643473877781366672350864752755588022824777610175711727490271630269455549216270053545760276...
result:
ok single line: '392470249673721133697239949760...9777330619218830402681117022793'
Test #60:
score: 0
Accepted
time: 68ms
memory: 3760kb
input:
67836 95
output:
317888180743681548059215767794886969452864740397390273620620438391034728853026340318384430454917611236919413366132056914579270506365699435600117965276275339651122216719926376209045640340784995692234439103799026790703289500442179536917700253488607595817196022441737743020960467339837955078666396037384...
result:
ok single line: '317888180743681548059215767794...7955078666396037384587296370893'
Test #61:
score: 0
Accepted
time: 157ms
memory: 3932kb
input:
71722 26
output:
247693603030421281681207294137732657877434966236750810089568986643860409192947506070077202204866466685499053241660957290468752903039035865222506339187509713934817848335683756262789879648939461257839204786954298744702836450090591588682129984757185042934460818124304096453525541584729834275156531550067...
result:
ok single line: '247693603030421281681207294137...8121701371901159189172444135009'
Test #62:
score: 0
Accepted
time: 289ms
memory: 3956kb
input:
54106 7
output:
826084852236026196779744466988847160249330687915848671523206820405880326525747493683955865301434658840672278628691393866066955921158980421861203770739433375629369621560354551205580643696536063456731533886180884776433255548517122745532012403873098114921955503568415435356517624763782474184106303199203...
result:
ok single line: '826084852236026196779744466988...7322008436182800575025320713086'
Test #63:
score: 0
Accepted
time: 182ms
memory: 3872kb
input:
87339 34
output:
120455141052924160566226262837467255564925956759767646612024773783511619792584500202950540525223550580376268590046702881554986090742681860567668419406653909553088018869759319534179290200674261386054253221884764820965925778310286156161006150938740658404213568093332861194434744306663230392553186582315...
result:
ok single line: '120455141052924160566226262837...5754186101072620447085194280700'
Test #64:
score: 0
Accepted
time: 217ms
memory: 3960kb
input:
92072 30
output:
214929966669907868166873623284321572920233541109825141875750145873230288617901700231521598695158202500977523371100574067095203100790851778451332421046606069861854286206186482300212718303355235027865663898808575548141093783941183119395238750859310018946961422995169386082800227470499935178614716255087...
result:
ok single line: '214929966669907868166873623284...6483797973261831915582783352667'
Test #65:
score: 0
Accepted
time: 642ms
memory: 3964kb
input:
88336 8
output:
289184617564136857823509934084578658210683317261613698218509482774747772902539365818707268924528065061769472153825129762722088979436877693248409190820010538505630594730372930155842172061883310999295680716262315480626757274813941589192999565894074356688340033967882651974784726298070391702419269467184...
result:
ok single line: '289184617564136857823509934084...5997884492126117279347358674418'
Test #66:
score: 0
Accepted
time: 172ms
memory: 3896kb
input:
98884 50
output:
218729618445723377776340429310221384937784026937239288642103061947960556598445723135955774432581805137428587156629502709657464788132765356802255310840003553615586965634128751862552739110226143230380572160375311255331521100361892156149951077614178523301311762137101871508957744132794418720618927562563...
result:
ok single line: '218729618445723377776340429310...1230004371472903565048079846832'
Test #67:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
21427 4901
output:
44
result:
ok single line: '44'
Test #68:
score: 0
Accepted
time: 1ms
memory: 3744kb
input:
33503 4752
output:
648
result:
ok single line: '648'
Test #69:
score: 0
Accepted
time: 0ms
memory: 3916kb
input:
15521 4649
output:
16
result:
ok single line: '16'
Test #70:
score: 0
Accepted
time: 1ms
memory: 3816kb
input:
35505 4702
output:
1069
result:
ok single line: '1069'
Test #71:
score: 0
Accepted
time: 1ms
memory: 3820kb
input:
36441 4913
output:
935
result:
ok single line: '935'
Test #72:
score: 0
Accepted
time: 1ms
memory: 3744kb
input:
16927 4529
output:
24
result:
ok single line: '24'
Test #73:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
23339 4072
output:
173
result:
ok single line: '173'
Test #74:
score: 0
Accepted
time: 0ms
memory: 3924kb
input:
27552 4392
output:
298
result:
ok single line: '298'
Test #75:
score: 0
Accepted
time: 1ms
memory: 3708kb
input:
36584 4103
output:
4188
result:
ok single line: '4188'
Test #76:
score: 0
Accepted
time: 1ms
memory: 3744kb
input:
30210 4872
output:
277
result:
ok single line: '277'
Test #77:
score: 0
Accepted
time: 1ms
memory: 3848kb
input:
15914 4189
output:
25
result:
ok single line: '25'
Test #78:
score: 0
Accepted
time: 1ms
memory: 3748kb
input:
18417 4113
output:
49
result:
ok single line: '49'
Test #79:
score: 0
Accepted
time: 1ms
memory: 3744kb
input:
34499 4985
output:
569
result:
ok single line: '569'
Test #80:
score: 0
Accepted
time: 0ms
memory: 3740kb
input:
34612 4537
output:
1155
result:
ok single line: '1155'
Test #81:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
20647 4735
output:
44
result:
ok single line: '44'
Test #82:
score: 0
Accepted
time: 0ms
memory: 3736kb
input:
18601 4445
output:
37
result:
ok single line: '37'
Test #83:
score: 0
Accepted
time: 1ms
memory: 3740kb
input:
34291 4214
output:
1922
result:
ok single line: '1922'
Test #84:
score: 0
Accepted
time: 1ms
memory: 3788kb
input:
27032 4690
output:
179
result:
ok single line: '179'
Test #85:
score: 0
Accepted
time: 1ms
memory: 3732kb
input:
21343 4822
output:
47
result:
ok single line: '47'
Test #86:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
30922 4687
output:
412
result:
ok single line: '412'
Test #87:
score: 0
Accepted
time: 0ms
memory: 3740kb
input:
15799 4763
output:
15
result:
ok single line: '15'
Test #88:
score: 0
Accepted
time: 1ms
memory: 3732kb
input:
36351 4073
output:
4224
result:
ok single line: '4224'
Test #89:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
24347 4412
output:
140
result:
ok single line: '140'
Test #90:
score: 0
Accepted
time: 1ms
memory: 3752kb
input:
30859 4263
output:
782
result:
ok single line: '782'
Test #91:
score: 0
Accepted
time: 1ms
memory: 3732kb
input:
25714 4965
output:
100
result:
ok single line: '100'
Test #92:
score: 0
Accepted
time: 1ms
memory: 3820kb
input:
33914 4105
output:
2176
result:
ok single line: '2176'
Test #93:
score: 0
Accepted
time: 1ms
memory: 3788kb
input:
33729 4580
output:
887
result:
ok single line: '887'
Test #94:
score: 0
Accepted
time: 1ms
memory: 3736kb
input:
23900 4103
output:
190
result:
ok single line: '190'
Test #95:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
32796 4136
output:
1561
result:
ok single line: '1561'
Test #96:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
15458 4472
output:
18
result:
ok single line: '18'
Test #97:
score: 0
Accepted
time: 3ms
memory: 3740kb
input:
100000 10000
output:
12372
result:
ok single line: '12372'
Test #98:
score: 0
Accepted
time: 0ms
memory: 3732kb
input:
100000 33333
output:
11
result:
ok single line: '11'
Test #99:
score: 0
Accepted
time: 0ms
memory: 3736kb
input:
100000 66666
output:
3
result:
ok single line: '3'
Test #100:
score: 0
Accepted
time: 1ms
memory: 3740kb
input:
100000 99999
output:
2
result:
ok single line: '2'