QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#853547 | #9728. Catch the Star | HoMaMaOvO (Riku Kawasaki, Masaki Nishimoto, Yui Hosaka)# | AC ✓ | 531ms | 22084kb | C++23 | 31.3kb | 2025-01-11 17:28:54 | 2025-01-11 17:28:58 |
Judging History
answer
#ifndef LOCAL
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
#endif
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define int ll
bool dbg=false;
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define pb push_back
#define eb emplace_back
#define a first
#define b second
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
#define si(x) int(x.size())
#ifdef LOCAL
#define dmp(x) cerr<<__LINE__<<" "<<#x<<" "<<x<<endl
#else
#define dmp(x) void(0)
#endif
template<class t,class u> bool chmax(t&a,u b){if(a<b){a=b;return true;}else return false;}
template<class t,class u> bool chmin(t&a,u b){if(b<a){a=b;return true;}else return false;}
template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;
using pi=pair<int,int>;
using vi=vc<int>;
using vvi=vc<vc<int>>;
template<class t,class u>
ostream& operator<<(ostream& os,const pair<t,u>& p){
return os<<"{"<<p.a<<","<<p.b<<"}";
}
template<class t> ostream& operator<<(ostream& os,const vc<t>& v){
os<<"{";
for(auto e:v)os<<e<<",";
return os<<"}";
}
#define mp make_pair
#define mt make_tuple
#define one(x) memset(x,-1,sizeof(x))
#define zero(x) memset(x,0,sizeof(x))
#ifdef LOCAL
void dmpr(ostream&os){os<<endl;}
template<class T,class... Args>
void dmpr(ostream&os,const T&t,const Args&... args){
os<<t<<" ";
dmpr(os,args...);
}
#define dmp2(...) dmpr(cerr,__LINE__,##__VA_ARGS__)
#else
#define dmp2(...) void(0)
#endif
using uint=unsigned;
using ull=unsigned long long;
template<class t,size_t n>
ostream& operator<<(ostream&os,const array<t,n>&a){
return os<<vc<t>(all(a));
}
ll rand_int(ll l, ll r) { //[l, r]
//#ifdef LOCAL
static mt19937_64 gen;
/*#else
static mt19937_64 gen(chrono::steady_clock::now().time_since_epoch().count());
#endif*/
return uniform_int_distribution<ll>(l, r)(gen);
}
ll rand_int(ll k){ //[0,k)
return rand_int(0,k-1);
}
string rand_string(int n,char lw,char up){
string s(n,'?');
rep(i,n)s[i]=rand_int(lw,up);
return s;
}
int current_run_id,run_batch_size=1000;
int calc_random_limit(){
return current_run_id/run_batch_size+1;
}
template<class t>
void generate_single(t&a){
a=rand_int(1,calc_random_limit());
}
void generate_single(string&a){
int n;generate_single(n);
a=rand_string(n,'a','b');
}
template<class t,class u>
void generate_single(pair<t,u>&a){
generate_single(a.a);
generate_single(a.b);
}
//https://trap.jp/post/1224/
template<class... Args>
void input(Args&... a){
if(dbg){
(generate_single(a),...);
}else{
#ifdef USE_FAST_IO
sc.read(a...);
#else
(cin >> ... >> a);
#endif
}
}
#define INT(...) int __VA_ARGS__;input(__VA_ARGS__)
#define LL(...) ll __VA_ARGS__;input(__VA_ARGS__)
#define ULL(...) ull __VA_ARGS__;input(__VA_ARGS__)
#define STR(...) string __VA_ARGS__;input(__VA_ARGS__)
#define CHR(...) char __VA_ARGS__;input(__VA_ARGS__)
#define DBL(...) double __VA_ARGS__;input(__VA_ARGS__)
#define LD(...) ld __VA_ARGS__;input(__VA_ARGS__)
#define overload3(a,b,c,d,...) d
#define VI2(name,size) vi name(size);rep(i_##name,size)input(name[i_##name]);
#define VI3(name,size,offset) vi name(size);rep(i_##name,size)input(name[i_##name]),name[i_##name]+=offset;
#define VI(...) overload3(__VA_ARGS__,VI3,VI2)(__VA_ARGS__)
#define VPI(name,size) vc<pi> name(size);rep(i_##name,size)input(name[i_##name].a,name[i_##name].b);
#define VVI(name,sizeN,sizeM) vvi name(sizeN,vi(sizeM));\
rep(i_##name,sizeN)rep(j_##name,sizeM)input(name[i_##name][j_##name]);
#define VS(name,size) vc<string> name(size);rep(i_##name,size)input(name[i_##name]);
#define VMI(name,size) vc<mint> name(size);rep(i_##name,size){INT(tmp_##name);name[i_##name]=tmp_##name;};
#define overload5(a,b,c,d,e,f,...) f
#define VVC4(type,name,sizeN,sizeM) vvc<type> name(sizeN,vc<type>(sizeM));
#define VVC5(type,name,sizeN,sizeM,ini) vvc<type> name(sizeN,vc<type>(sizeM,ini));
#define VVC(...) overload5(__VA_ARGS__,VVC5,VVC4)(__VA_ARGS__)
template<class T>
T vvvc(T v){
return v;
}
template<class T,class...Args>
auto vvvc(int n,T v,Args...args){
return vector(n,vvvc(v,args...));
}
template<int i,class T>
void print_tuple(ostream&,const T&){
}
template<int i,class T,class H,class ...Args>
void print_tuple(ostream&os,const T&t){
if(i)os<<",";
os<<get<i>(t);
print_tuple<i+1,T,Args...>(os,t);
}
template<class ...Args>
ostream& operator<<(ostream&os,const tuple<Args...>&t){
os<<"{";
print_tuple<0,tuple<Args...>,Args...>(os,t);
return os<<"}";
}
void printsuc(int suc){
#ifdef USE_FAST_IO
if(suc==1)pr.write('\n');
if(suc==2)pr.write(' ');
#else
if(suc==1){
if(dbg)cout<<endl;
else{
#ifdef LOCAL
cout<<endl;
#else
cout<<"\n";
#endif
}
}
if(suc==2)
cout<<" ";
#endif
}
template<class t>
void print_single(t x,int suc=1){
#ifdef USE_FAST_IO
pr.write(x);
#else
cout<<x;
#endif
printsuc(suc);
}
template<class t,class u>
void print_single(const pair<t,u>&p,int suc=1){
print_single(p.a,2);
print_single(p.b,suc);
}
template<class T>
void print_single(const vector<T>&v,int suc=1){
rep(i,v.size())
print_single(v[i],i==int(v.size())-1?3:2);
printsuc(suc);
}
template<class T,size_t N>
void print_single(const array<T,N>&v,int suc=1){
rep(i,N)
print_single(v[i],i==int(N)-1?3:2);
printsuc(suc);
}
template<class T>
void print(const T&t){
print_single(t);
}
template<class T,class ...Args>
void print(const T&t,const Args&...args){
print_single(t,2);
print(args...);
}
template<class T>
void printvv(const vvc<T>&vs){
for(const auto&row:vs)print(row);
}
string readString(){
string s;
cin>>s;
return s;
}
template<class T>
T sq(const T& t){
return t*t;
}
void YES(bool ex=true){
cout<<"YES\n";
if(ex)exit(0);
#ifdef LOCAL
cout.flush();
#endif
}
void NO(bool ex=true){
cout<<"NO\n";
if(ex)exit(0);
#ifdef LOCAL
cout.flush();
#endif
}
void Yes(bool ex=true){
cout<<"Yes\n";
if(ex)exit(0);
#ifdef LOCAL
cout.flush();
#endif
}
void No(bool ex=true){
cout<<"No\n";
if(ex)exit(0);
#ifdef LOCAL
cout.flush();
#endif
}
//#define CAPITAL
/*
void yes(bool ex=true){
#ifdef CAPITAL
cout<<"YES"<<"\n";
#else
cout<<"Yes"<<"\n";
#endif
if(ex)exit(0);
#ifdef LOCAL
cout.flush();
#endif
}
void no(bool ex=true){
#ifdef CAPITAL
cout<<"NO"<<"\n";
#else
cout<<"No"<<"\n";
#endif
if(ex)exit(0);
#ifdef LOCAL
cout.flush();
#endif
}*/
void possible(bool ex=true){
#ifdef CAPITAL
cout<<"POSSIBLE"<<"\n";
#else
cout<<"Possible"<<"\n";
#endif
if(ex)exit(0);
#ifdef LOCAL
cout.flush();
#endif
}
void impossible(bool ex=true){
#ifdef CAPITAL
cout<<"IMPOSSIBLE"<<"\n";
#else
cout<<"Impossible"<<"\n";
#endif
if(ex)exit(0);
#ifdef LOCAL
cout.flush();
#endif
}
constexpr ll ten(int n){
return n==0?1:ten(n-1)*10;
}
const ll infLL=LLONG_MAX/3;
#ifdef int
const int inf=infLL;
#else
const int inf=INT_MAX/2-100;
#endif
int topbit(signed t){
return t==0?-1:31-__builtin_clz(t);
}
int topbit(ll t){
return t==0?-1:63-__builtin_clzll(t);
}
int topbit(ull t){
return t==0?-1:63-__builtin_clzll(t);
}
int botbit(signed a){
return a==0?32:__builtin_ctz(a);
}
int botbit(ll a){
return a==0?64:__builtin_ctzll(a);
}
int botbit(ull a){
return a==0?64:__builtin_ctzll(a);
}
int popcount(signed t){
return __builtin_popcount(t);
}
int popcount(ll t){
return __builtin_popcountll(t);
}
int popcount(ull t){
return __builtin_popcountll(t);
}
int bitparity(ll t){
return __builtin_parityll(t);
}
bool ispow2(int i){
return i&&(i&-i)==i;
}
ll mask(int i){
return (ll(1)<<i)-1;
}
ull umask(int i){
return (ull(1)<<i)-1;
}
ll minp2(ll n){
if(n<=1)return 1;
else return ll(1)<<(topbit(n-1)+1);
}
bool inc(int a,int b,int c){
return a<=b&&b<=c;
}
template<class S> void mkuni(S&v){
sort(all(v));
v.erase(unique(all(v)),v.ed);
}
template<class t> bool isuni(vc<t> v){
int s=si(v);
mkuni(v);
return si(v)==s;
}
template<class t>
void myshuffle(vc<t>&a){
rep(i,si(a))swap(a[i],a[rand_int(0,i)]);
}
template<class S,class u>
int lwb(const S&v,const u&a){
return lower_bound(all(v),a)-v.bg;
}
template<class t,class u>
bool bis(const vc<t>&v,const u&a){
return binary_search(all(v),a);
}
//VERIFY: yosupo
//KUPC2017J
//AOJDSL1A
//without rank
struct unionfind{
vi p,s;
int c;
unionfind(int n):p(n,-1),s(n,1),c(n){}
void clear(){
fill(all(p),-1);
fill(all(s),1);
c=si(p);
}
int find(int a){
return p[a]==-1?a:(p[a]=find(p[a]));
}
//set b to a child of a
bool unite(int a,int b){
a=find(a);
b=find(b);
if(a==b)return false;
p[b]=a;
s[a]+=s[b];
c--;
return true;
}
bool same(int a,int b){
return find(a)==find(b);
}
int sz(int a){
return s[find(a)];
}
};
vvc<int> readGraph(int n,int m){
vvc<int> g(n);
rep(i,m){
int a,b;
cin>>a>>b;
//sc.read(a,b);
a--;b--;
g[a].pb(b);
g[b].pb(a);
}
return g;
}
vvc<int> rand_tree(int n){
vvc<int> t(n);
unionfind uf(n);
while(uf.c>1){
int a=rand_int(n);
int b=rand_int(n);
if(uf.unite(a,b)){
t[a].pb(b);
t[b].pb(a);
}
}
return t;
}
vvc<int> readTree(int n){
if(dbg){
return rand_tree(n);
}else{
return readGraph(n,n-1);
}
}
vi readRooted(int n){
assert(!dbg);
vi par(n,-1);
rng(i,1,n){
input(par[i]);
par[i]--;
assert(inc(0,par[i],i-1));
}
return par;
}
void printTree(const vvc<int> t){
int n=si(t);
int degsum=0;
rep(i,n)degsum+=si(t[i]);
if(degsum==n-1){
//directed
rep(i,si(t))for(auto j:t[i]){
print(i+1,j+1);
}
}else if(degsum==2*(n-1)){
//undirected
rep(i,si(t))for(auto j:t[i])if(i<j){
print(i+1,j+1);
}
}else{
assert(false);
}
}
template<class t>
vc<t> presum(const vc<t>&a){
vc<t> s(si(a)+1);
rep(i,si(a))s[i+1]=s[i]+a[i];
return s;
}
vc<ll> presum(const vi&a){
vc<ll> s(si(a)+1);
rep(i,si(a))s[i+1]=s[i]+a[i];
return s;
}
//BIT で数列を管理するときに使う (CF850C)
template<class t>
vc<t> predif(vc<t> a){
gnr(i,1,si(a))a[i]-=a[i-1];
return a;
}
template<class t>
vvc<ll> imos(const vvc<t>&a){
int n=si(a),m=si(a[0]);
vvc<ll> b(n+1,vc<ll>(m+1));
rep(i,n)rep(j,m)
b[i+1][j+1]=b[i+1][j]+b[i][j+1]-b[i][j]+a[i][j];
return b;
}
//verify してないや
void transvvc(int&n,int&m){
swap(n,m);
}
template<class t,class... Args>
void transvvc(int&n,int&m,vvc<t>&a,Args&...args){
assert(si(a)==n);
vvc<t> b(m,vi(n));
rep(i,n){
assert(si(a[i])==m);
rep(j,m)b[j][i]=a[i][j];
}
a.swap(b);
transvvc(n,m,args...);
}
//CF854E
void rotvvc(int&n,int&m){
swap(n,m);
}
template<class t,class... Args>
void rotvvc(int&n,int&m,vvc<t>&a,Args&...args){
assert(si(a)==n);
vvc<t> b(m,vi(n));
rep(i,n){
assert(si(a[i])==m);
rep(j,m)b[m-1-j][i]=a[i][j];
}
a.swap(b);
rotvvc(n,m,args...);
}
//ソートして i 番目が idx[i]
//CF850C
template<class t>
vi sortidx(const vc<t>&a){
int n=si(a);
vi idx(n);iota(all(idx),0);
sort(all(idx),[&](int i,int j){return a[i]<a[j];});
return idx;
}
//vs[i]=a[idx[i]]
//例えば sortidx で得た idx を使えば単にソート列になって返ってくる
//CF850C
template<class t>
vc<t> a_idx(const vc<t>&a,const vi&idx){
int n=si(a);
assert(si(idx)==n);
vc<t> vs(n);
rep(i,n)vs[i]=a[idx[i]];
return vs;
}
//CF850C
vi invperm(const vi&p){
int n=si(p);
vi q(n);
rep(i,n)q[p[i]]=i;
return q;
}
template<class t,class s=t>
s SUM(const vc<t>&a){
return accumulate(all(a),s(0));
}
template<class t,size_t K,class s=t>
s SUM(const array<t,K>&a){
return accumulate(all(a),s(0));
}
template<class t>
t MAX(const vc<t>&a){
return *max_element(all(a));
}
template<class t>
pair<t,int> MAXi(const vc<t>&a){
auto itr=max_element(all(a));
return mp(*itr,itr-a.bg);
}
template<class A>
auto MIN(const A&a){
return *min_element(all(a));
}
template<class t>
pair<t,int> MINi(const vc<t>&a){
auto itr=min_element(all(a));
return mp(*itr,itr-a.bg);
}
vi vid(int n){
vi res(n);iota(all(res),0);
return res;
}
template<class S>
void soin(S&s){
sort(all(s));
}
template<class S,class F>
void soin(S&s,F&&f){
sort(all(s),forward<F>(f));
}
template<class S>
S soout(S s){
soin(s);
return s;
}
template<class S>
void rein(S&s){
reverse(all(s));
}
template<class S>
S reout(S s){
rein(s);
return s;
}
template<class t,class u>
pair<t,u>&operator+=(pair<t,u>&a,pair<t,u> b){
a.a+=b.a;a.b+=b.b;return a;}
template<class t,class u>
pair<t,u>&operator-=(pair<t,u>&a,pair<t,u> b){
a.a-=b.a;a.b-=b.b;return a;}
template<class t,class u>
pair<t,u> operator+(pair<t,u> a,pair<t,u> b){return mp(a.a+b.a,a.b+b.b);}
template<class t,class u>
pair<t,u> operator-(pair<t,u> a,pair<t,u> b){return mp(a.a-b.a,a.b-b.b);}
template<class t,class u,class v>
pair<t,u>&operator*=(pair<t,u>&a,v b){
a.a*=b;a.b*=b;return a;}
template<class t,class u,class v>
pair<t,u> operator*(pair<t,u> a,v b){return a*=b;}
template<class t,class u>
pair<t,u> operator-(pair<t,u> a){return mp(-a.a,-a.b);}
namespace std{
template<class t,class u>
istream&operator>>(istream&is,pair<t,u>&a){
return is>>a.a>>a.b;
}
}
template<class t,size_t n>
array<t,n>&operator+=(array<t,n>&a,const array<t,n>&b){
rep(i,n)a[i]+=b[i];
return a;
}
template<class t,size_t n,class v>
array<t,n>&operator*=(array<t,n>&a,v b){
rep(i,n)a[i]*=b;
return a;
}
template<class t,size_t n>
array<t,n> operator+(array<t,n> a,const array<t,n>&b){return a+=b;}
template<class t,size_t n,class v>
array<t,n> operator*(array<t,n> a,v b){return a*=b;}
template<class t>
t gpp(vc<t>&vs){
assert(si(vs));
t res=move(vs.back());
vs.pop_back();
return res;
}
template<class t,class u>
void pb(vc<t>&a,const vc<u>&b){
a.insert(a.ed,all(b));
}
template<class t,class...Args>
vc<t> cat(vc<t> a,Args&&...b){
(pb(a,forward<Args>(b)),...);
return a;
}
template<class t,class u>
vc<t>& operator+=(vc<t>&a,u x){
for(auto&v:a)v+=x;
return a;
}
template<class t,class u>
vc<t> operator+(vc<t> a,u x){
return a+=x;
}
template<class t>
vc<t>& operator+=(vc<t>&a,const vc<t>&b){
a.resize(max(si(a),si(b)));
rep(i,si(b))a[i]+=b[i];
return a;
}
template<class t>
vc<t> operator+(const vc<t>&a,const vc<t>&b){
vc<t> c(max(si(a),si(b)));
rep(i,si(a))c[i]+=a[i];
rep(i,si(b))c[i]+=b[i];
return c;
}
template<class t,class u>
vc<t>& operator-=(vc<t>&a,u x){
for(auto&v:a)v-=x;
return a;
}
template<class t,class u>
vc<t> operator-(vc<t> a,u x){
return a-=x;
}
template<class t>
vc<t>& operator-=(vc<t>&a,const vc<t>&b){
a.resize(max(si(a),si(b)));
rep(i,si(b))a[i]-=b[i];
return a;
}
/*
template<class t>
vc<t> operator-(const vc<t>&a,const vc<t>&b){
vc<t> c(max(si(a),si(b)));
rep(i,si(a))c[i]+=a[i];
rep(i,si(b))c[i]-=b[i];
return c;
}
*/
template<class t,class u>
vc<t>& operator*=(vc<t>&a,u x){
for(auto&v:a)v*=x;
return a;
}
template<class t,class u>
vc<t> operator*(vc<t> a,u x){
return a*=x;
}
template<class t,class u>
vc<t>& operator/=(vc<t>&a,u x){
for(auto&v:a)v/=x;
return a;
}
template<class t,class u>
vc<t> operator/(vc<t> a,u x){
return a/=x;
}
template<class t>
vc<t>& operator<<=(vc<t>&a,int k){
assert(k>=0);
a.insert(a.bg,k,t(0));
return a;
}
template<class t>
vc<t> operator<<(vc<t> a,int k){
return a<<=k;
}
template<class t>
vc<t>& operator>>=(vc<t>&a,int k){
if(si(a)<=k)a.clear();
else a.erase(a.bg,a.bg+k);
return a;
}
template<class t>
vc<t> operator>>(vc<t> a,int k){
return a>>=k;
}
template<class t,class u>
void remval(vc<t>&a,const u&v){
a.erase(remove(all(a),v),a.ed);
}
//消した要素の個数を返してくれる
//UCUP 2-8-F
template<class t,class F>
int remif(vc<t>&a,F f){
auto itr=remove_if(all(a),f);
int res=a.ed-itr;
a.erase(itr,a.ed);
return res;
}
template<class t>
void rempos(vc<t>&a,int i){
assert(inc(0,i,si(a)-1));
a.erase(a.bg+i);
}
template<class VS,class u>
void fila(VS&vs,const u&a){
fill(all(vs),a);
}
template<class t,class u>
int findid(const vc<t>&vs,const u&a){
auto itr=find(all(vs),a);
if(itr==vs.ed)return -1;
else return itr-vs.bg;
}
template<class t>
void rtt(vc<t>&vs,int i){
rotate(vs.bg,vs.bg+i,vs.ed);
}
//Multiuni2023-8 C
//f(lw)=false,...,f(n-1)=false,f(n)=true,...,f(up)=true,
//のときに n を返す
template<class F>
int find_min_true(int lw,int up,F f){
while(up-lw>1){
const int mid=(lw+up)/2;
if(f(mid))up=mid;
else lw=mid;
}
return up;
}
//f(lw)=true,f(up)=false
template<class F>
int find_max_true(int lw,int up,F f){
while(up-lw>1){
const int mid=(lw+up)/2;
if(f(mid))lw=mid;
else up=mid;
}
return lw;
}
template<class t> using pqmin=priority_queue<t,vc<t>,greater<t>>;
template<class t> using pqmax=priority_queue<t>;
using T=tuple<int,int,int>;
//copied from yosupo's library
//PARTLY VERIFIED
//USACO 2022 January ptlatinum C
//#define GEOF
#ifdef GEOF
using ld=long double;
//using ld=double;
const ld PI=acos(ld(-1));
#else
using ld=ll;
#endif
const ld eps=1e-9;
int sgn(ld a){return a<-eps?-1:(a>eps?1:0);}
int sgn(ld a,ld b){return sgn(a-b);}
/*
using pt=complex<ld>;
#define x real()
#define y imag()
*/
struct pt {
ld x,y;
//pt(ld _x = ld(0), ld _y = ld(0)) : x(_x), y(_y) {}
pt():x(0),y(0){}
pt(ld xx,ld yy):x(xx),y(yy){}
pt operator+(const pt& r) const { return {x + r.x, y + r.y}; }
pt operator-(const pt& r) const { return {x - r.x, y - r.y}; }
pt operator*(const pt& r) const {
return {x * r.x - y * r.y, x * r.y + y * r.x};
}
pt inv()const{
ld d=norm();
return {x/d,-y/d};
}
pt operator/(const pt&r)const{
return operator*(r.inv());
}
pt operator*(const ld& r) const { return {x * r, y * r}; }
pt operator/(const ld& r) const { return {x / r, y / r}; }
pt& operator+=(const pt& r) { return *this = *this + r; }
pt& operator-=(const pt& r) { return *this = *this - r; }
pt& operator*=(const pt& r) { return *this = *this * r; }
pt& operator/=(const pt& r) { return *this = *this / r; }
pt& operator*=(const ld& r) { return *this = *this * r; }
pt& operator/=(const ld& r) { return *this = *this / r; }
pt operator-() const { return {-x, -y}; }
static int cmp(const pt&a,const pt&b){
int v=sgn(a.x,b.x);
return v?v:sgn(a.y,b.y);
}
bool operator<(const pt& r) const {
return cmp(*this,r)<0;
}
bool operator<=(const pt& r) const {
return cmp(*this,r)<=0;
}
bool operator>(const pt& r) const {
return cmp(*this,r)>0;
}
bool operator==(const pt& r) const { return sgn((*this - r).rabs()) == 0; }
bool operator!=(const pt& r) const { return !(*this == r); }
ld norm() const { return x * x + y * y; }
ld rabs() const { return max(std::abs(x), std::abs(y)); } // robust abs
pair<ld, ld> to_pair() const { return {x, y}; }
#ifdef GEOF
ld abs() const { return sqrt(norm()); }
ld arg() const { return atan2(y, x); }
static pt polar(ld le, ld th) { return {le * cos(th), le * sin(th)}; }
#endif
};
istream& operator>>(istream& is, pt& p){
return is>>p.x>>p.y;
}
ostream& operator<<(ostream& os, const pt& p) {
return os << "pt(" << p.x << ", " << p.y << ")";
}
ld norm(const pt&a){
return a.norm();
}
ld rabs(const pt&a){
return a.rabs();
}
#ifdef GEOF
ld abs(const pt&a){
return sqrt(norm(a));
}
//XXII Opencup Gpt of Ural K
pt normalized(const pt&a){
return a/abs(a);
}
ld arg(const pt&a){return a.arg();}
//normalize to [-PI,PI)
//Contest 2: ptKU Contest 1, ptTZ Summer 2022 Day 4
ld normarg(ld a){
ld res=fmod(a+PI,2*PI);
if(res<0)res+=PI;
else res-=PI;
return res;
}
//normalize to [0,2*PI)
//Multiuni2023-10-E
ld normarg_nonnegative(ld a){
ld res=fmod(a,2*PI);
if(res<0)res+=2*PI;
return res;
}
//AOJ1183
//arg between ab
//assume given lengths are valid
ld arg(ld a,ld b,ld c){
return acos(min(max((a*a+b*b-c*c)/(2*a*b),ld(-1)),ld(1)));
}
//UCUP 2-20-D
ld heron(ld a,ld b,ld c){
ld s=(a+b+c)/2;
return sqrt(s*(s-a)*(s-b)*(s-c));
}
#endif
ld norm(const pt&a,const pt&b){
return (a-b).norm();
}
ld dot(const pt&a,const pt&b){return a.x*b.x+a.y*b.y;}
ld crs(const pt& a,const pt& b){return a.x*b.y-a.y*b.x;}
ld crs(const pt& a,const pt& b,const pt& c){return crs(b-a,c-a);}
int ccw(const pt& a,const pt& b){return sgn(crs(a,b));}
int ccw(const pt& a,const pt& b,const pt& c){return ccw(b-a,c-a);}
//(-pi,0](0,pi]
int argtype(const pt&a){
if(sgn(a.y)==0)return a.x<0?1:0;
return a.y<0?0:1;
}
int argcmp(const pt&a,const pt&b){
int at=argtype(a),bt=argtype(b);
if(at!=bt)return at<bt?-1:1;
return -ccw(a,b);
};
bool argless(const pt&a,const pt&b){return argcmp(a,b)<0;}
//c の位置を聞く関数です,b じゃないです
//(-2)[a,-1](0)[b,1](2)
int bet(pt a,pt b,pt c){
pt d=b-a;
ld e=dot(d,c-a);
if(sgn(e)<=0)return sgn(e)-1;
return sgn(e-norm(d))+1;
}
//AOJ0153
//三角形 abc に d が含まれるか?0-no,1-edge,2-in
int cont(pt a,pt b,pt c,pt d){
if(ccw(a,b,c)==-1) swap(b,c);
return min({ccw(a,b,d),ccw(b,c,d),ccw(c,a,d)})+1;
}
//(a,b) を結ぶ直線を考え,x 座標との交点の y 座標を求める
//(分子,分母)を返す
pair<ld,ld> xcut(const pt&a,const pt&b,ld x){
return mp(a.y*(b.x-x)-b.y*(a.x-x),b.x-a.x);
}
//XXII Opencup Gpt of Ural K
pt rot90(pt a){
return pt(-a.y,a.x);
}
#ifdef GEOF
//Multiuni 2024-6-C
pt rot(pt a,ld b){
ld c=cos(b),s=sin(b);
return pt(a.x*c-a.y*s,a.x*s+a.y*c);
}
ld xcutval(const pt&a,const pt&b,ld x){
auto [p,q]=xcut(a,b,x);
return p/q;
}
//AOJ1183
//Xmas2010 E
//-+ の 順で返す
//a の符号により,small/large が決まる
int qeq(ld a,ld b,ld c,ld&d,ld&e){
if(sgn(a)==0){
if(sgn(b)==0)return 0;
d=-c/b;
return 1;
}
ld f=b*b-4*a*c;
if(sgn(f)<0)return 0;
ld g=sqrt(max(f,ld(0)));
d=(-b-g)/(2*a);
e=(-b+g)/(2*a);
return sgn(f)+1;
}
#else
pt normdir(pt a){
if(a==pt(0,0))return a;
int g=gcd(a.x,a.y);
return pt(a.x/g,a.y/g);
}
#endif
ld area2(const vc<pt>&ps){
ld res=0;
rep(i,si(ps))res+=crs(ps[i],ps[(i+1)%si(ps)]);
return res;
}
template<class... Args>void inputpt(Args&... a){(input(a.x,a.y),...);}
#define PT(...) ld __VA_ARGS__;inputpt(__VA_ARGS__)
#define VPT(name,size) vc<pt> name(size);rep(i_##name,size)inputpt(name[i_##name]);
using ln=pair<pt,pt>;
pt dir(ln a){return a.b-a.a;}
pt eval(ln a,ld b){return a.a+dir(a)*b;}
ld crs(ln a,pt b){return crs(a.a,a.b,b);}
int ccw(ln a,pt b){return ccw(a.a,a.b,b);}
int bet(ln a,pt b){return bet(a.a,a.b,b);}
ld projt(ln a,pt b){
pt c=dir(a);
return dot(c,b-a.a)/norm(c);
}
pt proj(ln a,pt b){
pt c=dir(a);
return a.a+c*dot(c,b-a.a)/norm(c);
}
pt refl(ln a,pt b){
return proj(a,b)*2-b;
}
//AOJ1157
//0-no,1-yes(endpoint),2-yes(innner),3-overelap
//if the two line touch like this
// x----x----x
//it returns 1
int iss(ln a,ln b){
int c1=ccw(a.a,a.b,b.a),c2=ccw(a.a,a.b,b.b);
int d1=ccw(b.a,b.b,a.a),d2=ccw(b.a,b.b,a.b);
if(c1||c2||d1||d2)return 1-max(c1*c2,d1*d2);
int f=bet(a.a,a.b,b.a),g=bet(a.a,a.b,b.b);
if(max(f,g)==-2||min(f,g)==2)return 0;
if(max(f,g)==-1||min(f,g)==1)return 1;
return 3;
}
//segment a intersects line b?
//endpoints inclusive
bool isl(ln a,ln b){
int d1=ccw(b.a,b.b,a.a),d2=ccw(b.a,b.b,a.b);
return d1*d2<=0;
}
//並行でない->true, というだけ
//直線が一致とかは考えてないことに注意
bool ill(ln a,ln b){
return ccw(dir(a),dir(b));
}
ld cllt(ln a,ln b){
return crs(b.a,b.b,a.a)/crs(dir(a),dir(b));
}
//ICPC Yokohama 2022 J
pair<ld,ld> clltf(ln a,ln b){
return mp(crs(b.a,b.b,a.a),crs(dir(a),dir(b)));
}
//AOJ1033
pt cll(ln a,ln b){
return eval(a,crs(b.a,b.b,a.a)/crs(dir(a),dir(b)));
}
//UCUP3-4-H
bool isp(ln a,pt b){
return ccw(a,b)==0&&inc(-1,bet(a.a,a.b,b),1);
}
#ifdef GEOF
//AOJ2201
ld dlp(ln a,pt b){
return abs(crs(a,b)/abs(dir(a)));
}
//AOJ0153
ld dsp(ln a,pt b){
pt c=proj(a,b);
if(abs(bet(a.a,a.b,c))<=1)return abs(b-c);
return min(abs(b-a.a),abs(b-a.b));
}
//ABC314H
//b から最も近い a 上の点を返す
pt dsp_tar(ln a,pt b){
pt c=proj(a,b);
if(abs(bet(a.a,a.b,c))<=1)return c;
return abs(b-a.a)<abs(b-a.b)?a.a:a.b;
}
//AOJ1157
ld dss(ln a,ln b){
if(iss(a,b))return 0;
return min({dsp(a,b.a),dsp(a,b.b),dsp(b,a.a),dsp(b,a.b)});
}
//AOJ2160
//反時計回り方向に伸びる垂直二等分線
ln vbis(pt a,pt b){
pt c=(a+b)*ld(0.5),d=b-a;
return ln(c,pt(c.x-d.y,c.y+d.x));
}
ld cutareat(ln z,ld l,ld r){
pt a=eval(z,l);
pt b=eval(z,r);
return -(b.x-a.x)*(a.y+b.y)/2;
}
#endif
//ABC286H
//simple polygon と線分が交わるか
//接している場合も true
/*
bool icl(const vc<pt>&ps,ln z){
int n=si(ps);
rep(i,n){
pt p=ps[i],q=ps[(i+1)%n];
if(iss(z,ln(p,q)))return true;
}
return cont(ps,z.a);
}*/
//デバッグ実行でオーバーフローするとコアダンプしがち
using int128=__int128_t;
using uint128=unsigned __int128_t;
istream& operator>>(istream&is,int128&res){
res=0;
string s;is>>s;
int head=0;
int128 w=1;
if(s[0]=='-'){
w=-1;
head++;
}
while(head<int(s.size())){
res=res*10+s[head++]-'0';
}
res*=w;
return is;
}
ostream& operator<<(ostream&os,int128 i){
if(i==0)
return os<<0;
static char buf[100];
if(i<0){
os<<"-";
i=-i;
}
int p=0;
while(i){
buf[p++]='0'+i%10;
i/=10;
}
reverse(buf,buf+p);
buf[p]=0;
return os<<buf;
}
ostream& operator<<(ostream&os,uint128 i){
if(i==0)
return os<<0;
static char buf[100];
int p=0;
while(i){
buf[p++]='0'+i%10;
i/=10;
}
reverse(buf,buf+p);
buf[p]=0;
return os<<buf;
}
int128 abs128(int128 a){
return a<0?-a:a;
}
int botbit(int128 a){
const int128 m=(int128(1)<<64)-1;
if(a&m)return __builtin_ctzll(ll(a));
else return __builtin_ctzll(ll(a>>64))+64;
}
int128 gcd(int128 a,int128 b){
if(a<0)a=-a;
if(b<0)b=-b;
if(a==0)return b;
if(b==0)return a;
int128 s=botbit(a|b);
a>>=botbit(a);
do{
b>>=botbit(b);
if(a>b)swap(a,b);
b-=a;
}while(b);
return a<<s;
}
const int128 inf128=int128(1)<<122;
//UCUP 2-Prime-97
int128 fld(int128 a,int128 b) { // floored division
return a / b - ((a ^ b) < 0 && a % b); }
//UCUP 2-Prime-43
int128 cld(int128 a, int128 b) { // ceiled division
return a / b + ((a ^ b) > 0 && a % b); }
//a,c O(10^36)
//b,d O(10^18)
//a/b, c/d の大小比較
int cmpfrac(int128 a,int128 b,int128 c,int128 d){
assert(b);
assert(d);
if(b<0){
a=-a;
b=-b;
}
if(d<0){
c=-c;
d=-d;
}
int128 x=fld(a,b),y=fld(c,d);
if(x<y)return -1;
if(x>y)return 1;
int128 u=(a-x*b)*d,v=(c-y*d)*b;
if(u<v)return -1;
if(u>v)return 1;
return 0;
}
bool inc(int128 a,int128 b,int128 c){
return a<=b&&b<=c;
}
int fraccmp(pi a,pi b){
if(a.b<0)a*=-1;
if(b.b<0)b*=-1;
int128 z=int128(a.a)*b.b-int128(b.a)*a.b;
return z<0?-1:z==0?0:1;
}
bool fracless(pi a,pi b){
return fraccmp(a,b)<0;
}
vc<pi> overlap_ranges(const vc<pt>&ps,ln z){
const int n=si(ps);
vc<pi> res;
rep(i,n){
pt p=ps[i],q=ps[(i+1)%n],r=ps[(i+n-1)%n];
int a=ccw(z,p),b=ccw(z,q);
if(a*b==-1){
res.pb(clltf(z,ln(p,q)));
}
if(a==0){
pi u(rabs(ps[i]-z.a),rabs(dir(z)));
int c=ccw(z,r);
if(b*c<0){
res.pb(u);
}
}
}
assert(si(res)%2==0);
soin(res,fracless);
return res;
}
//上がって下がる
//最大や最小では同じ値を 2 個までとっても許される
//それ以外は隣あうところは全部違う値にしてくれ
//f(a,b) は単に calc(a)<calc(b) を返す
template<class F>
int periodic_max_cmp(int n,F f){
if(n==1)return 0;
//auto h=f(0);
//bool up=h<f(1);
bool up=f(0,1);
int lb=0,ub=n;
while(ub-lb>1){
int m=(ub+lb)/2;
//if(f(m)<h){
if(f(m%n,0)){
if(up)ub=m;
else lb=m;
}else{
//if(f(m)<f(m+1))lb=m;
if(f(m%n,(m+1)%n))lb=m;
else ub=m;
}
}
//return f(lb)<f(ub)?ub%n:lb%n;
return f(lb%n,ub%n)?ub%n:lb%n;
}
vc<pt> readps(){
INT(n);
VPT(ps,n);
return ps;
}
void slv(){
INT(m,L,R);
auto tar=readps();
vvc<pt> ms(m);
rep(i,m)ms[i]=readps();
ln base(pt(0,0),pt(1,0));
vc<pair<pi,pi>> bad;
for(auto cur:ms){
auto sub=[&](pt z)->pair<ln,ln>{
int r=periodic_max_cmp(si(tar),[&](int i,int j){
return ccw(z,tar[j],tar[i])>0;
});
int l=periodic_max_cmp(si(tar),[&](int i,int j){
return ccw(z,tar[j],tar[i])<0;
});
return mp(ln(z,tar[l]),ln(z,tar[r]));
};
auto [resL,resR]=sub(cur[0]);
rng(i,1,si(cur)){
auto [wl,wr]=sub(cur[i]);
if(ccw(dir(resL),dir(wl))>0)resL=wl;
if(ccw(dir(resR),dir(wr))<0)resR=wr;
}
dmp(resL);
dmp(resR);
pt dL=dir(resL);
pt dR=dir(resR);
int from=findid(cur,resL.a);
int to=findid(cur,resR.a);
vc<pt> ls;
{
int i=from;
while(1){
ls.pb(cur[i]);
if(i==to)break;
i=(i+1)%si(cur);
}
}
int s=si(ls);
dmp(ls);
pi ul=pi(L,1),ur=pi(R,1);
bool any=false;
auto updL=[&](pi u){
any=true;
if(fracless(ul,u))ul=u;
};
auto updR=[&](pi u){
any=true;
if(fracless(u,ur))ur=u;
};
{
ln w(ls[0],ls[0]-dL);
if(ill(w,base)){
if(fracless(pi(0,1),clltf(w,base))){
pi u=clltf(base,w);
if(dir(w).y>0)updL(u);
else updR(u);
}
}
}
{
ln w(ls[s-1],ls[s-1]-dR);
if(ill(w,base)){
if(fracless(pi(0,1),clltf(w,base))){
pi u=clltf(base,w);
if(dir(w).y>0)updR(u);
else updL(u);
}
}
}
rep(i,s-1){
if(ccw(base,ls[i])*ccw(base,ls[i+1])<0){
pi u=clltf(base,ln(ls[i],ls[i+1]));
if(ls[i+1].y>ls[i].y)updR(u);
else updL(u);
}
}
{
pt v=ls[0]-dL;
ls.insert(ls.bg,v);
s++;
}
{
pt v=ls[s-1]-dR;
ls.insert(ls.ed,v);
s++;
}
rng(i,1,s-1){
if(ccw(base,ls[i])==0&&ccw(base,ls[i-1])*ccw(base,ls[i+1])<0){
//pi u(rabs(ls[i]-base.a),rabs(dir(base)));
pi u(ls[i].x,1);
if(ls[i+1].y>ls[i-1].y)updR(u);
else updL(u);
}
}
if(any&&fracless(ul,ur)){
dmp2(ul,ur);
bad.eb(ul,ur);
}
}
{
soin(bad,[&](pair<pi,pi>a,pair<pi,pi>b){
int z=fraccmp(a.a,b.a);
if(z)return z<0;
else return fracless(a.b,b.b);
});
int s=0;
for(auto [l,r]:bad){
if(s>0&&fracless(l,bad[s-1].b)){
if(fracless(bad[s-1].b,r))bad[s-1].b=r;
}else{
bad[s++]=mp(l,r);
}
}
bad.resize(s);
}
using V=long double;
V ans=0;
auto adddif=[&](pi a,pi b){
V w=V(a.a)/a.b-V(b.a)/b.b;
assert(w>=0);
ans+=w;
};
bool can=false;
if(bad.empty()){
ans=R-L;
can=true;
}
else{
int s=si(bad);
if(fracless(pi(L,1),bad[0].a)){
can=true;
adddif(bad[0].a,pi(L,1));
}
if(fracless(bad[s-1].b,pi(R,1))){
can=true;
adddif(pi(R,1),bad[s-1].b);
}
rep(i,s-1){
can=true;
adddif(bad[i+1].a,bad[i].b);
}
}
if(!can)print(-1);
else print(ans);
}
signed main(signed argc,char*argv[]){
if(argc>1&&strcmp(argv[1],"D")==0)dbg=true;
cin.tie(0);
ios::sync_with_stdio(0);
cout<<fixed<<setprecision(20);
if(dbg){
while(1){
if(current_run_id%run_batch_size==0){
cerr<<"Current Run "<<current_run_id<<endl;
}
slv();
current_run_id++;
}
}else{
int t;cin>>t;rep(_,t)
slv();
}
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 4008kb
input:
2 4 -8 8 3 -7 7 -6 8 -7 8 3 -9 -2 -7 3 -9 -1 3 -2 3 0 2 -4 5 3 5 1 5 3 4 2 3 1 -1 2 -2 3 -1 5 -8 8 5 -14 -3 -10 -2 -9 2 -10 4 -12 5 3 -16 0 -15 0 -15 1 3 -15 6 -9 5 -15 7 3 -10 5 -9 5 -10 6 3 -7 3 -3 2 -8 4 3 -6 -1 -6 -2 -5 -1
output:
9.40476190476190476199 6.00000000000000000000
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
3 1 -4 4 3 -2 6 0 5 2 6 3 -3 1 3 1 0 4 3 -2 2 3 -2 4 2 4 0 6 3 -2 2 -1 2 -2 3 3 1 2 2 2 2 3 3 -2 -1 0 -3 2 -1 1 1 2 3 -8 0 -7 0 -8 1 3 -5 0 -4 -1 -4 0
output:
-1 0.00000000000000000000 1.00000000000000000000
result:
ok 3 numbers
Test #3:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
1 1 -744567334 955216804 5 -781518205 -852078097 -781516900 -852078384 -781516392 -852076569 -781518329 -852076047 -781519925 -852077600 5 -393011614 -131855702 -393010699 -131856607 -393008846 -131856475 -393009388 -131854587 -393010201 -131854694
output:
1699779738.69197919231373816729
result:
ok found '1699779738.691979170', expected '1699779738.691979170', error '0.000000000'
Test #4:
score: 0
Accepted
time: 33ms
memory: 3628kb
input:
16666 2 -732787031 -732787030 3 -798263477 735869144 -583647039 529057159 -583647039 529057160 3 -777230180 499482549 -777230181 499482549 -777230180 499482548 3 -661853868 251627327 -661853868 251627326 -661853867 251627327 2 463140451 463140452 3 232604219 637008523 797038205 345997813 797038205 3...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok 16666 numbers
Test #5:
score: 0
Accepted
time: 33ms
memory: 3944kb
input:
16667 2 -9 7 3 -8 4 -6 1 -4 2 3 6 13 2 12 3 10 3 -1 7 0 10 -3 4 2 -9 5 3 -8 10 -5 8 -4 10 3 10 -8 9 -11 12 -8 3 -10 -5 -8 -4 -7 -1 2 -6 5 3 -8 6 -7 6 -5 7 3 -2 -3 1 -4 -4 -2 3 1 10 0 10 -1 8 2 -9 9 3 -5 -11 -2 -11 -5 -8 3 6 -5 5 -2 4 -5 3 11 6 9 3 11 3 2 -6 5 3 -7 6 -8 7 -9 4 3 9 2 12 -3 11 0 3 -6 3...
output:
16.00000000000000000000 14.00000000000000000000 11.00000000000000000000 15.55555555555555555594 -1 12.00000000000000000000 14.00000000000000000000 17.00000000000000000000 11.00000000000000000000 16.00000000000000000000 11.00000000000000000000 15.00000000000000000000 15.00000000000000000000 10.000000...
result:
ok 16667 numbers
Test #6:
score: 0
Accepted
time: 32ms
memory: 3920kb
input:
16667 2 -6 10 3 6 -8 8 -10 9 -7 3 -5 13 -6 10 -6 8 3 8 10 7 7 10 7 2 -8 7 3 2 -10 0 -12 3 -11 3 -6 -7 -3 -5 -4 -4 3 10 -3 8 -3 8 -6 2 -7 6 3 9 1 9 4 6 1 3 7 -6 4 -8 6 -8 3 -3 -12 -4 -10 -5 -14 2 -10 10 3 11 -4 9 -1 9 -3 3 -6 -7 -6 -8 -5 -5 3 -10 -7 -7 -10 -6 -10 2 -9 8 3 3 2 3 1 6 5 3 4 -2 0 -3 1 -3...
output:
16.00000000000000000000 12.14285714285714285702 13.00000000000000000000 20.00000000000000000000 17.00000000000000000000 13.00000000000000000000 15.00000000000000000000 16.00000000000000000000 19.00000000000000000000 11.00000000000000000000 15.00000000000000000000 20.00000000000000000000 15.000000000...
result:
ok 16667 numbers
Test #7:
score: 0
Accepted
time: 34ms
memory: 3888kb
input:
16667 2 -20 15 3 17 -17 22 -14 14 -16 3 -5 -12 -3 -8 -8 -12 3 11 8 15 10 8 8 2 -10 12 3 -14 -13 -19 -9 -11 -17 3 14 13 10 12 14 9 3 -5 -20 -7 -17 -7 -20 2 -11 10 3 0 -24 -1 -20 -5 -19 3 -12 -2 -15 -5 -12 -5 3 10 -21 14 -24 14 -19 2 -15 20 3 -3 -16 -4 -10 -6 -15 3 8 17 7 12 10 17 3 8 -7 10 -5 11 -3 2...
output:
35.00000000000000000000 22.00000000000000000000 21.00000000000000000000 29.23076923076923076816 31.00000000000000000000 37.00000000000000000000 17.25000000000000000000 38.00000000000000000000 37.00000000000000000000 31.00000000000000000000 30.00000000000000000000 33.00000000000000000000 27.000000000...
result:
ok 16667 numbers
Test #8:
score: 0
Accepted
time: 34ms
memory: 4116kb
input:
16667 2 -19 19 3 18 -12 22 -15 20 -12 3 24 0 20 2 20 -3 3 15 25 18 20 19 22 2 -18 20 3 10 6 11 11 7 8 3 26 -21 20 -12 21 -17 3 -4 -13 -11 -19 -6 -18 2 -13 14 3 19 -4 20 0 17 -7 3 1 -8 6 -12 3 -7 3 12 -7 5 -2 10 -6 2 -18 12 3 14 -5 15 -6 17 -4 3 18 -20 15 -19 20 -22 3 14 -8 18 -3 12 -10 2 -14 15 3 17...
output:
38.00000000000000000000 38.00000000000000000000 13.80000000000000000017 30.00000000000000000000 29.00000000000000000000 25.00000000000000000000 27.00000000000000000000 27.00000000000000000000 29.00000000000000000000 28.00000000000000000000 27.00000000000000000000 34.00000000000000000000 35.000000000...
result:
ok 16667 numbers
Test #9:
score: 0
Accepted
time: 41ms
memory: 3888kb
input:
8334 5 -17 14 5 -9 13 -12 15 -15 10 -15 9 -13 9 5 24 4 22 9 17 13 20 8 23 4 4 -11 4 -12 6 -17 9 -14 6 5 -7 23 -10 19 -10 17 -1 23 -3 28 4 23 -16 20 -11 15 -7 11 -11 5 15 -9 14 -9 15 -12 19 -14 20 -10 5 -11 10 5 -4 8 -1 10 -13 16 -14 15 -9 11 5 9 2 12 5 14 10 2 4 4 1 5 20 -12 23 -15 29 -10 27 -9 22 -...
output:
20.00000000000000000000 15.00000000000000000000 34.00000000000000000000 21.00000000000000000000 25.00000000000000000000 21.00000000000000000000 21.00000000000000000000 35.00000000000000000000 6.33333333333333333304 32.00000000000000000000 28.00000000000000000000 -1 25.00000000000000000000 30.0000000...
result:
ok 8334 numbers
Test #10:
score: 0
Accepted
time: 41ms
memory: 3900kb
input:
8334 5 -10 19 5 28 13 20 10 24 8 28 8 29 13 5 -5 24 -5 20 -1 19 4 22 -1 24 5 -15 11 -10 8 -9 8 -12 13 -14 16 5 -4 16 -5 11 -1 16 -1 18 -2 21 3 12 21 13 13 17 18 4 -19 7 -15 10 -19 14 -20 12 5 -19 10 5 17 10 14 10 11 8 10 6 11 4 3 -5 -2 -10 -7 -5 -12 4 18 -4 20 -1 20 2 15 -3 4 -16 -4 -20 -5 -16 -9 -1...
output:
29.00000000000000000000 29.00000000000000000000 27.00000000000000000000 35.00000000000000000000 35.00000000000000000000 27.00000000000000000000 33.00000000000000000000 33.40000000000000000139 8.50000000000000000000 34.00000000000000000000 29.00000000000000000000 29.00000000000000000000 29.0000000000...
result:
ok 8334 numbers
Test #11:
score: 0
Accepted
time: 37ms
memory: 3884kb
input:
8334 5 -24 23 5 -2 -9 -8 -9 -5 -13 0 -14 1 -10 3 -15 -8 -10 -4 -16 -7 5 0 -45 1 -45 5 -41 4 -40 -2 -43 3 8 32 9 27 12 30 5 33 1 36 -2 41 1 43 4 32 6 5 5 -35 7 -34 5 -30 1 -30 -2 -33 5 -38 33 5 44 29 39 34 35 35 36 34 41 30 5 29 25 32 20 36 18 37 22 31 27 4 29 15 33 12 38 12 33 17 5 -33 -29 -33 -30 -...
output:
34.59999999999999999861 -1 63.00000000000000000000 25.00000000000000000000 47.75000000000000000000 52.82352941176470588480 49.00000000000000000000 62.00000000000000000000 50.55172413793103448204 42.00000000000000000000 39.00000000000000000000 63.00000000000000000000 38.81818181818181818371 37.736842...
result:
ok 8334 numbers
Test #12:
score: 0
Accepted
time: 40ms
memory: 4116kb
input:
8334 5 -22 38 5 10 -32 12 -30 9 -25 6 -22 6 -27 4 -38 27 -38 24 -37 24 -35 29 4 42 14 42 17 41 18 39 11 3 4 13 -3 15 -1 10 5 -36 5 -27 13 -30 15 -34 13 -36 10 4 -17 -9 -16 -4 -21 -3 -19 -7 5 -28 20 5 41 -2 33 -9 35 -9 37 -8 38 -7 5 5 -15 4 -16 4 -19 5 -23 9 -23 3 -7 -39 -6 -40 -3 -37 3 34 3 37 4 30 ...
output:
57.71428571428571428770 48.00000000000000000000 55.00000000000000000000 59.00000000000000000000 52.66666666666666666435 54.31250000000000000000 65.00000000000000000000 40.04048582995951417046 5.14285714285714285789 32.94117647058823529493 61.00000000000000000000 41.00000000000000000000 58.8260869565...
result:
ok 8334 numbers
Test #13:
score: 0
Accepted
time: 74ms
memory: 4116kb
input:
8334 5 -27 34 10 -34 40 -35 39 -39 31 -40 27 -35 25 -30 26 -28 30 -27 33 -27 37 -31 39 9 19 20 21 24 19 29 17 29 16 28 7 16 9 12 13 11 16 15 6 1 -20 7 -28 11 -29 12 -26 10 -22 6 -17 10 40 -48 42 -45 43 -40 39 -36 35 -35 30 -37 28 -40 28 -45 30 -48 35 -50 7 44 -3 49 0 51 2 50 7 48 10 43 5 39 0 8 20 -...
output:
53.27999999999999999889 59.00000000000000000000 71.00000000000000000000 59.00000000000000000000 11.00000000000000000000 47.00000000000000000000 4.59999999999999999861 41.73333333333333333356 71.00000000000000000000 17.73076923076923076816 46.35294117647058823387 70.00000000000000000000 43.9393939393...
result:
ok 8334 numbers
Test #14:
score: 0
Accepted
time: 74ms
memory: 3836kb
input:
8334 5 -20 29 10 32 17 27 20 25 20 20 16 26 6 31 5 32 5 36 6 37 9 36 14 7 -28 29 -28 33 -32 32 -37 29 -40 27 -37 26 -32 25 7 39 23 36 26 33 28 31 29 28 27 30 22 32 18 8 1 13 5 13 6 17 4 22 0 26 -4 24 -5 19 -3 15 8 -26 28 -23 23 -19 25 -15 29 -13 34 -23 36 -27 36 -27 33 8 4 39 2 38 -2 33 -2 32 0 27 3...
output:
49.00000000000000000000 51.00000000000000000000 55.00000000000000000000 -1 59.00000000000000000000 23.26666666666666666644 40.53846153846153846367 34.13513513513513513570 28.39999999999999999965 73.00000000000000000000 54.05263157894736842160 59.00000000000000000000 18.16666666666666666609 66.000000...
result:
ok 8334 numbers
Test #15:
score: 0
Accepted
time: 110ms
memory: 4132kb
input:
8334 5 -3126 3527 40 2524 -3205 2555 -3204 2565 -3202 2571 -3200 2573 -3199 2582 -3194 2590 -3189 2593 -3187 2597 -3182 2603 -3174 2608 -3164 2610 -3159 2612 -3149 2611 -3139 2608 -3134 2606 -3132 2598 -3125 2588 -3120 2583 -3118 2575 -3115 2565 -3112 2555 -3110 2553 -3110 2544 -3111 2538 -3112 2528...
output:
6508.69526047786917377636 6121.00000000000000000000 5228.14605087984021247749 7545.00000000000000000000 6439.30168490475789599969 5552.00000000000000000000 7258.00000000000000000000 4340.00000000000000000000 7161.00000000000000000000 6347.00000000000000000000 6490.56942142993799027550 7132.550454048...
result:
ok 8334 numbers
Test #16:
score: 0
Accepted
time: 114ms
memory: 4028kb
input:
8334 5 -2274 2353 40 2604 1999 2602 1992 2601 1985 2601 1984 2603 1974 2606 1965 2610 1955 2613 1948 2623 1940 2633 1938 2636 1939 2644 1944 2651 1949 2660 1956 2713 2008 2718 2015 2721 2021 2720 2031 2719 2040 2718 2048 2717 2051 2713 2060 2708 2070 2698 2078 2692 2080 2685 2082 2676 2083 2672 2082...
output:
4298.54962566006799606910 5799.00000000000000000000 4987.36505130971150379082 7308.00000000000000000000 5589.70376034822103683553 4652.00000000000000000000 6082.14174614634885784881 6086.00000000000000000000 3355.76614450335074590903 6459.00000000000000000000 6291.00000000000000000000 4838.000000000...
result:
ok 8334 numbers
Test #17:
score: 0
Accepted
time: 206ms
memory: 4084kb
input:
2274 5 -29040 32893 40 21293 3672 21285 3680 21278 3685 21271 3688 21266 3690 21258 3693 21255 3694 21254 3694 21245 3693 21239 3692 21223 3687 21218 3684 21214 3680 21208 3673 21203 3667 21198 3659 21195 3650 21193 3643 21191 3633 21194 3624 21198 3616 21203 3609 21211 3600 21220 3590 21221 3589 21...
output:
61933.00000000000000000000 35500.50000000000000000000 49406.00000000000000000000 67961.06673024960765872038 54610.00000000000000000000 63846.00000000000000000000 54004.00000000000000000000 48450.54339922606453683329 48956.33275865308729990488 60754.00000000000000000000 62140.87790921051610837367 683...
result:
ok 2274 numbers
Test #18:
score: 0
Accepted
time: 211ms
memory: 4148kb
input:
2271 5 -21608 38109 40 3288 29821 3282 29828 3277 29833 3268 29840 3258 29846 3256 29847 3250 29849 3240 29852 3233 29854 3228 29855 3220 29856 3218 29856 3212 29855 3210 29854 3205 29851 3197 29846 3189 29840 3179 29831 3176 29827 3171 29820 3165 29811 3163 29807 3160 29797 3167 29789 3172 29784 31...
output:
59717.00000000000000000000 62108.00000000000000000000 57257.00000000000000000000 66813.38931556253518095900 65446.00000000000000000000 59441.15996084618944905742 55000.00000000000000000000 70062.36764271788123892293 61092.72227050713498641699 62176.00000000000000000000 58821.00000000000000000000 550...
result:
ok 2271 numbers
Test #19:
score: 0
Accepted
time: 255ms
memory: 3920kb
input:
1997 5 -685963307 853750511 100 372319561 823923262 372319594 823923310 372319621 823923350 372319653 823923400 372319681 823923445 372319710 823923492 372319721 823923511 372319739 823923548 372319750 823923572 372319764 823923603 372319780 823923639 372319785 823923651 372319795 823923692 37231980...
output:
1539712423.49484853015746921301 1259604092.00000000000000000000 1674868892.00000000000000000000 1100380125.00000000000000000000 1314807604.00000000000000000000 1476460075.00000000000000000000 1657770700.00000000000000000000 1681539925.00000000000000000000 1479119212.00000000000000000000 1631814313.2...
result:
ok 1997 numbers
Test #20:
score: 0
Accepted
time: 249ms
memory: 3924kb
input:
1998 5 -923518671 909017531 100 921654169 61734551 921654198 61734600 921654221 61734644 921654467 61735150 921654480 61735178 921654498 61735219 921654513 61735254 921654521 61735279 921654530 61735323 921654538 61735365 921654541 61735403 921654531 61735447 921654520 61735489 921654511 61735514 92...
output:
1832536202.00000000000000000000 1443062393.55361966381315141916 1680030554.00000000000000000000 1744446320.93008612201083451509 1205113181.00000000000000000000 1326796808.00000000000000000000 1213723402.19448848348110914230 1578305206.62132887286134064198 1334732988.95880832837428897619 1129359860.2...
result:
ok 1998 numbers
Test #21:
score: 0
Accepted
time: 53ms
memory: 4116kb
input:
8334 5 -744567334 955216804 5 -781518205 -852078097 -781516900 -852078384 -781516392 -852076569 -781518329 -852076047 -781519925 -852077600 3 871916993 -588891734 871918253 -588892444 871918745 -588891234 5 -393011614 -131855702 -393010699 -131856607 -393008846 -131856475 -393009388 -131854587 -3930...
output:
1699779738.69197919231373816729 1527796251.09027266921475529671 1655793192.92683334194589406252 1672892305.00000000000000000000 1368134291.00000000000000000000 1463897904.00000000000000000000 1363175149.00000000000000000000 1296404984.00000000000000000000 1424194359.00000000000000000000 1029663073.0...
result:
ok 8334 numbers
Test #22:
score: 0
Accepted
time: 54ms
memory: 3884kb
input:
8334 5 -829825735 601784461 5 714610651 -975306485 714610404 -975306399 714609317 -975307983 714610491 -975308230 714610739 -975307741 5 -478043159 166470433 -478042674 166466411 -478041707 166468042 -478041795 166469844 -478042741 166471670 5 -574496064 117824476 -574497244 117826229 -574498481 117...
output:
1431606742.60044413816649466753 1730324827.00000000000000000000 1908650236.11841755732893943787 1890778564.00000000000000000000 1340666568.00000000000000000000 1319811364.00000000000000000000 1421853075.00000000000000000000 1490477103.00000000000000000000 1873755437.00000000000000000000 1570402518.0...
result:
ok 8334 numbers
Test #23:
score: 0
Accepted
time: 98ms
memory: 3892kb
input:
8334 5 -913048220 656325022 10 -166143242 -673183677 -166142264 -673184186 -166140797 -673184088 -166139127 -673183351 -166137499 -673182562 -166137324 -673182139 -166138589 -673181699 -166140193 -673181144 -166141964 -673181446 -166142469 -673181967 6 -945075435 650359787 -945076678 650360341 -9450...
output:
1569349415.91434589226264506578 1880676443.00000000000000000000 1316771742.00000000000000000000 1107991785.00000000000000000000 1549997697.44417372415773570538 1824059958.00000000000000000000 1444570056.00000000000000000000 1418459383.00000000000000000000 1505112947.00000000000000000000 1326424768.4...
result:
ok 8334 numbers
Test #24:
score: 0
Accepted
time: 94ms
memory: 3888kb
input:
8334 5 -894419066 986206278 10 438340992 -480519836 438342647 -480520761 438343571 -480520315 438344403 -480519603 438345824 -480518172 438346510 -480516618 438345277 -480515164 438343852 -480515669 438342447 -480516557 438340542 -480518404 10 -240550387 -258562092 -240551334 -258563442 -240550967 -...
output:
1880625344.00000000000000000000 1466897680.33736021514050662518 1494132112.28329104755539447069 1408363298.69581656809896230698 1390133394.00000000000000000000 1485867441.42186682322062551975 1590839506.00000000000000000000 1556522174.34431285865139216185 1614474976.00000000000000000000 1231693774.0...
result:
ok 8334 numbers
Test #25:
score: 0
Accepted
time: 248ms
memory: 4024kb
input:
2004 5 -851485863 922356807 100 806952389 -620838027 806952796 -620839051 806952929 -620839348 806953823 -620841099 806955255 -620843002 806956607 -620844576 806958351 -620846452 806958738 -620846812 806960698 -620848575 806962485 -620850179 806964065 -620851590 806965685 -620852945 806966771 -62085...
output:
1773665579.39621464500669389963 1245647086.00000000000000000000 1698103416.98956645047292113304 1192937188.00000000000000000000 1495810673.00000000000000000000 1331670703.05329302884638309479 1550766126.00000000000000000000 1572739123.00000000000000000000 1403505529.75080687750596553087 1564997181.0...
result:
ok 2004 numbers
Test #26:
score: 0
Accepted
time: 256ms
memory: 4056kb
input:
2001 5 -807916374 951640620 100 471800611 -609005450 471800882 -609005598 471802784 -609006412 471803897 -609006871 471804858 -609007255 471806094 -609007726 471807518 -609008221 471808084 -609008358 471830663 -609011338 471831366 -609011271 471832821 -609011131 471834532 -609010816 471835066 -60901...
output:
1759556994.00000000000000000000 1438355564.00000000000000000000 1162987446.00000000000000000000 1473770184.00000000000000000000 1660711599.30487924884073436260 1258059674.00000000000000000000 1509519860.00000000000000000000 1502232261.35154826845973730087 1622595242.00000000000000000000 1116409602.0...
result:
ok 2001 numbers
Test #27:
score: 0
Accepted
time: 168ms
memory: 3884kb
input:
10000 4 -876359283 597412519 84 -787103890 -543670676 -787103889 -543670617 -787103891 -543670566 -787103894 -543670542 -787103904 -543670486 -787103936 -543670413 -787103965 -543670352 -787104009 -543670286 -787104058 -543670216 -787104095 -543670169 -787104166 -543670087 -787104201 -543670047 -787...
output:
1473771802.00000000000000000000 1184445109.00000000000000000000 1273369968.00000000000000000000 1842104023.14911000407300889492 1401842961.36550476681441068649 1220676735.00000000000000000000 1584003979.00000000000000000000 1936415212.60360231227241456509 1439576635.00000000000000000000 1536198292.0...
result:
ok 10000 numbers
Test #28:
score: 0
Accepted
time: 161ms
memory: 3824kb
input:
10000 4 -514589336 681051743 84 260136457 -778772788 260136398 -778772766 260136148 -778772704 260136080 -778772696 260135984 -778772691 260135939 -778772690 260135861 -778772692 260135765 -778772698 260135685 -778772707 260135618 -778772723 260135537 -778772753 260135478 -778772779 260135382 -77877...
output:
1195641079.00000000000000000000 1569912356.00000000000000000000 1518856735.00000000000000000000 1342714391.00000000000000000000 1214213079.00000000000000000000 1283220624.00000000000000000000 1796134134.93151069735176861286 1801713431.00000000000000000000 1728469471.00000000000000000000 1970762015.0...
result:
ok 10000 numbers
Test #29:
score: 0
Accepted
time: 151ms
memory: 3892kb
input:
10000 4 -854654469 777152266 84 -384437137 684560566 -384431810 684557290 -384422840 684552374 -384419937 684550899 -384413227 684547586 -384405159 684543922 -384396194 684540151 -384388285 684537901 -384381318 684537075 -384371666 684537161 -384370437 684537184 -384360706 684539373 -384351311 68454...
output:
1631806735.00000000000000000000 1424123468.00000000000000000000 1389677992.91877429408486932516 1576800025.00000000000000000000 1598916583.00000000000000000000 1464498679.00000000000000000000 1442804058.00000000000000000000 1666175099.00000000000000000000 1255050820.57015738147310912609 1561177121.7...
result:
ok 10000 numbers
Test #30:
score: 0
Accepted
time: 165ms
memory: 3940kb
input:
10000 4 -771015246 658891315 84 45385710 -738165668 45385885 -738161269 45383143 -738154169 45381155 -738149591 45376641 -738139660 45372989 -738132856 45368735 -738126806 45366451 -738123774 45362745 -738119336 45356788 -738112594 45349125 -738104101 45342610 -738097460 45340181 -738095044 45333803...
output:
1429897974.60892389097716659307 1599820440.00000000000000000000 1236214920.00000000000000000000 1209017337.67753588862251490355 1873859588.00000000000000000000 1497435375.64267678372561931610 1478507602.00000000000000000000 1482210060.00000000000000000000 1260810353.91480092424899339676 1951395191.1...
result:
ok 10000 numbers
Test #31:
score: 0
Accepted
time: 169ms
memory: 3884kb
input:
10000 4 -674914723 624418103 84 468468889 -499756104 468162339 -498888072 467601497 -497899887 466878219 -497038435 466134518 -496365273 465159179 -495560087 464211972 -495044122 464079613 -494973564 452212861 -493825380 452065957 -493824296 451407015 -493875285 450463932 -494062942 449543371 -49428...
output:
1264072929.76167022762820124626 1254262766.00000000000000000000 1663984089.00000000000000000000 1010711694.65403521363623440266 1470813291.00000000000000000000 1650827665.88299878407269716263 1254261966.00000000000000000000 1831622248.00000000000000000000 1374140339.00000000000000000000 1281253922.2...
result:
ok 10000 numbers
Test #32:
score: 0
Accepted
time: 161ms
memory: 3832kb
input:
10000 4 -793175674 721626772 84 159345272 608883920 159698008 608015757 160118829 607278757 160699965 606292987 161301597 605353770 161836414 604600518 162258566 604103305 163119033 603125136 163652511 602547566 164390150 601772176 164814728 601358247 165571440 600703011 166011409 600345459 16678223...
output:
1504659632.68152299523353576660 1455208210.00000000000000000000 1338582258.14593996270559728146 1165325420.67749658296816051006 1454903090.00000000000000000000 1213494640.00000000000000000000 1777063188.00000000000000000000 1517563822.73161818156950175762 1068984015.00000000000000000000 1565287784.0...
result:
ok 10000 numbers
Test #33:
score: 0
Accepted
time: 79ms
memory: 4816kb
input:
5 10000 -525096166 506746434 3000 528096060 105801840 528097856 105801473 528099429 105801157 528100970 105800858 528101306 105800793 528101727 105800712 528103238 105800425 528104747 105800149 528105868 105799944 528107064 105799731 528108575 105799463 528110431 105799134 528111385 105798965 528112...
output:
397560103.48163399595068767667 343764949.51692604887648485601 314995685.80404963897308334708 470388562.84052193770185112953 369514676.75808979803696274757
result:
ok 5 numbers
Test #34:
score: 0
Accepted
time: 78ms
memory: 5012kb
input:
5 10000 -501317113 815908190 3000 693478209 681557167 693478416 681557435 693479605 681558977 693480659 681560347 693481636 681561619 693481947 681562025 693482896 681563268 693484271 681565098 693485322 681566509 693486379 681567938 693487204 681569054 693488476 681570775 693489313 681571908 693490...
output:
1239559910.44609640724956989288 62025115.00769637104531284422 621348456.96606129215797409415 278611566.92579347052378579974 934652762.20964045077562332153
result:
ok 5 numbers
Test #35:
score: 0
Accepted
time: 207ms
memory: 6012kb
input:
5 10000 -700327508 702989707 3000 -254692935 -831597680 -254694172 -831597571 -254696030 -831597409 -254697316 -831597299 -254699111 -831597155 -254700632 -831597034 -254702548 -831596882 -254703508 -831596808 -254705371 -831596670 -254706070 -831596619 -254707817 -831596493 -254708500 -831596446 -2...
output:
240317371.96179611214029137045 417228210.06228071905206888914 145169437.63413252422469668090 154695358.79319138891878537834 661574446.56572383269667625427
result:
ok 5 numbers
Test #36:
score: 0
Accepted
time: 207ms
memory: 5620kb
input:
5 10000 -535756158 936247062 3000 166383130 232330358 166382163 232330545 166381842 232330607 166381505 232330671 166380376 232330885 166379421 232331055 166377849 232331322 166376034 232331630 166374935 232331812 166373259 232332089 166371346 232332404 166370470 232332548 166369905 232332639 166369...
output:
321848681.54154536940040998161 47132901.32017334244301309809 1221805373.45283774589188396931 1344708697.96007594733964651823 7305558.39494923982420004904
result:
ok 5 numbers
Test #37:
score: 0
Accepted
time: 429ms
memory: 19752kb
input:
2 10000 -758768479 517152843 3000 -196475875 -622544724 -196474245 -622545180 -196474129 -622545212 -196472878 -622545555 -196470969 -622546070 -196470160 -622546279 -196468698 -622546651 -196468113 -622546798 -196466578 -622547183 -196465475 -622547454 -196464203 -622547765 -196462700 -622548130 -1...
output:
253995254.63169906743860337883 1328238926.00000000000000000000
result:
ok 2 numbers
Test #38:
score: 0
Accepted
time: 425ms
memory: 19736kb
input:
2 10000 -573977895 641919861 3000 347121719 404913819 347122089 404915132 347122631 404917094 347122901 404918076 347123072 404918705 347123279 404919476 347123792 404921397 347124043 404922339 347124204 404922955 347124654 404924689 347125025 404926127 347125471 404927873 347125713 404928830 347126...
output:
173821476.89114840498950798064 1528471752.00000000000000000000
result:
ok 2 numbers
Test #39:
score: 0
Accepted
time: 413ms
memory: 19660kb
input:
1 648 -899534410 747361962 3000 211927638 493123207 211929268 493123656 211930155 493123901 211930800 493124086 211932237 493124502 211933656 493124916 211935226 493125375 211937118 493125929 211939099 493126531 211940702 493127019 211941925 493127397 211943096 493127759 211944029 493128048 21194475...
output:
1309979658.94625079666730016470
result:
ok found '1309979658.946250916', expected '1309979658.946250916', error '0.000000000'
Test #40:
score: 0
Accepted
time: 414ms
memory: 19664kb
input:
1 657 -611575720 891439134 3000 491719655 -542798612 491719658 -542799409 491719666 -542801221 491719679 -542802627 491719693 -542804004 491719721 -542805714 491719761 -542807477 491719782 -542808319 491719830 -542809996 491719886 -542811761 491719897 -542812096 491719958 -542813875 491719996 -54281...
output:
1432477725.35650210757739841938
result:
ok found '1432477725.356502056', expected '1432477725.356502056', error '0.000000000'
Test #41:
score: 0
Accepted
time: 161ms
memory: 6172kb
input:
5 10000 -856871457 916406527 100000 623227399 -926813077 623226044 -926814196 623225217 -926814879 623223907 -926815961 623223067 -926816655 623221482 -926817965 623220871 -926818470 623220092 -926819114 623218435 -926820484 623218013 -926820833 623216069 -926822441 623214200 -926823987 623212464 -9...
output:
-1 -1 -1 -1 -1
result:
ok 5 numbers
Test #42:
score: 0
Accepted
time: 162ms
memory: 6660kb
input:
5 10000 -699668634 624085557 100000 506101157 -445281877 506099344 -445280103 506097486 -445278285 506096559 -445277378 506096281 -445277106 506094668 -445275528 506094484 -445275348 506093473 -445274359 506092374 -445273284 506091779 -445272702 506090503 -445271454 506089547 -445270519 506088365 -4...
output:
-1 -1 220429319.20441204623784869909 -1 353925892.99097627436276525259
result:
ok 5 numbers
Test #43:
score: 0
Accepted
time: 333ms
memory: 7404kb
input:
5 10000 -622037374 817682512 100000 -625558743 -704636222 -625558729 -704635708 -625558689 -704634239 -625558645 -704632623 -625558596 -704630818 -625558559 -704629455 -625558512 -704627718 -625558462 -704625869 -625558419 -704624273 -625558408 -704623864 -625558394 -704623343 -625558347 -704621591 ...
output:
-1 -1 -1 -1 -1
result:
ok 5 numbers
Test #44:
score: 0
Accepted
time: 320ms
memory: 7452kb
input:
5 10000 -644173104 652456201 100000 541445295 171993628 541445566 171995010 541445715 171995770 541445953 171996985 541445972 171997082 541446355 171999041 541446730 172000960 541447072 172002712 541447310 172003932 541447682 172005839 541448025 172007598 541448409 172009568 541448554 172010312 5414...
output:
-1 -1 -1 -1 218592599.11233685360639356077
result:
ok 5 numbers
Test #45:
score: 0
Accepted
time: 508ms
memory: 19420kb
input:
1 9046 -641166309 543165538 100000 -951104070 580563380 -951104422 580563946 -951105279 580565324 -951106332 580567017 -951107420 580568766 -951108596 580570656 -951109784 580572565 -951110770 580574149 -951111357 580575092 -951111743 580575712 -951112233 580576499 -951112464 580576870 -951113492 58...
output:
-1
result:
ok found '-1.000000000', expected '-1.000000000', error '-0.000000000'
Test #46:
score: 0
Accepted
time: 531ms
memory: 19620kb
input:
1 9045 -740410642 652751190 100000 419533646 402821427 419534234 402821769 419536223 402822926 419538064 402823997 419540039 402825146 419541895 402826226 419543842 402827359 419545349 402828236 419546581 402828953 419548227 402829911 419548818 402830255 419550371 402831159 419551522 402831829 41955...
output:
-1
result:
ok found '-1.000000000', expected '-1.000000000', error '-0.000000000'
Test #47:
score: 0
Accepted
time: 525ms
memory: 22084kb
input:
1 18 -948940253 629185104 100000 -833855325 174303631 -833856017 174302309 -833856901 174300620 -833857808 174298887 -833858536 174297496 -833859435 174295778 -833860349 174294031 -833861196 174292412 -833861887 174291091 -833862420 174290072 -833863407 174288185 -833864012 174287028 -833864551 1742...
output:
1389928213.81501685408875346184
result:
ok found '1389928213.815016747', expected '1389928213.815016747', error '0.000000000'
Test #48:
score: 0
Accepted
time: 513ms
memory: 22008kb
input:
1 20 -934151185 527681557 100000 29124091 329049242 29124404 329047347 29124592 329046209 29124842 329044697 29125093 329043179 29125387 329041401 29125495 329040748 29125759 329039152 29126077 329037230 29126401 329035272 29126545 329034402 29126703 329033448 29126783 329032965 29127027 329031492 2...
output:
1461832742.00000000000000000000
result:
ok found '1461832742.000000000', expected '1461832742.000000000', error '0.000000000'
Extra Test:
score: 0
Extra Test Passed