#include<stdio.h> #include<algorithm> #define il inline usingnamespace std; constint N=1000005;
int n,X,Y; structnode{int x,y;}d[N];
il boolcmp(node a,node b){return a.x==b.x?a.y<b.y:a.x<b.x;}
intmain() { freopen("round.in","r",stdin),freopen("round.out","w",stdout); scanf("%d",&n); int i; for (i=1; i<=n; i++) scanf("%d%d",&d[i].x,&d[i].y); sort(d+1,d+n+1,cmp);
X=(d[1].x+d[n].x)/2,Y=(d[1].y+d[n].y)/2; for (i=2; i<=(n+1)/2; i++) if ((d[i].x+d[n-i+1].x)/2!=X||(d[i].y+d[n-i+1].y)/2!=Y) return0*puts("There is not a place like that."); printf("%d %d",X,Y);
#include<cstdio> #include<cmath> #define il inline usingnamespace std; constint N=505,M=1e5+5;
int n,hp,cd=-1,a[N],sum[N],dis[N],ok[N]; int to[M],nx[M],wt[M],hd[N],sze;
il voidadd(int u,int v,int w){to[++sze]=v,nx[sze]=hd[u],wt[sze]=w,hd[u]=sze;}
il intSPFA(int u) { ok[u]=1; int i,v; for (i=hd[u]; i!=n+1; i=nx[i]) if (dis[v=to[i]]<dis[u]+wt[i]) { dis[v]=dis[u]+wt[i]; if (ok[v]||SPFA(v)) return1; } return ok[u]=0; }
il boolcheck(int x) { int i,o=0; sze=0; for (i=0; i<=n; i++) dis[i]=ok[i]=0,hd[i]=n+1; for (i=1; i<=n; i++) add(i-1,i,0),add(i,i-1,-1); for (i=x; i<=n; i++) add(i,i-x,-1); for (i=1; i<n; i++) { if (sum[i+1]-hp+1<=0) continue; int pos=ceil(1.0*(sum[i+1]-hp+1)/15.0); if (pos>i) return0; add(pos-1,i,1); } for (i=0; i<=n&&!o; i++) o|=SPFA(i); return !o; }
intmain() { freopen("powerline.in","r",stdin),freopen("powerline.out","w",stdout); scanf("%d%d",&n,&hp); int i; for (i=1; i<=n; i++) scanf("%d",a+i),sum[i]=sum[i-1]+a[i]; int l=1,r=n,mid; while (l<=r) { mid=l+r>>1; if (check(mid)) cd=mid,l=mid+1; else r=mid-1; } if (cd==n) printf("Peanut can play with the wires at will."); elseprintf("%d",cd); return0; }