This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define MAXN 600007
using namespace std;
struct point{
int x,y;
}p[10],q[10];
int n,m,al,bl,aw,bw;
void solve(int id,int ax,int ay,int al,int aw,int bx,int by,int bl,int bw){
if(al==bl and aw==bw)return;
if(al>bl){
swap(al,bl); swap(aw,bw);
swap(ax,bx); swap(ay,by);
}
int k=aw/bw+(aw%bw!=0);
cout<<"scissors\n";
cout<<id<<" "<<k<<"\n";
for(int i=0;i<k;i++){
if(i<k-1 or (aw%bw==0))cout<<ax<<" "<<ay+i*bw<<" "<<ax+al<<" "<<ay+i*bw<<" "<<ax+al<<" "<<ay+(i+1)*bw<<" "<<ax<<" "<<ay+(i+1)*bw<<"\n";
else{
cout<<ax<<" "<<ay+i*bw<<" "<<ax+al<<" "<<ay+i*bw<<" "<<ax+al<<" "<<ay+aw<<" "<<ax<<" "<<ay+aw<<"\n";
}
}
cout<<"tape\n";
if(aw%bw==0){
cout<<k<<" ";
for(int i=1;i<=k;i++)cout<<id+i<<" ";
cout<<"\n";
for(int i=0;i<k;i++){
cout<<bx+i*al<<" "<<by<<" "<<bx+(i+1)*al<<" "<<by<<" "<<bx+(i+1)*al<<" "<<by+bw<<" "<<bx+i*al<<" "<<by+bw<<"\n";
}
return;
}else{
cout<<k-1<<" ";
for(int i=1;i<=k-1;i++)cout<<id+i<<" ";
cout<<"\n";
for(int i=0;i<k-1;i++){
cout<<bx+i*al<<" "<<by<<" "<<bx+(i+1)*al<<" "<<by<<" "<<bx+(i+1)*al<<" "<<by+bw<<" "<<bx+i*al<<" "<<by+bw<<"\n";
}
solve(id+k,ax+bw*k,ay,al,aw-bw*k , bx+k*al,by,bl-k*al,bw);
return;
}
}
int main(){
cin>>n;
for(int i=1;i<=n;i++){
cin>>p[i].x>>p[i].y;
}
al=p[2].x-p[1].x; aw=p[3].y-p[2].y;
cin>>m;
for(int i=1;i<=m;i++){
cin>>q[i].x>>q[i].y;
}
bl=q[2].x-q[1].x; bw=q[3].y-q[2].y;
solve(0,0,0,al,aw,0,0,bl,bw);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |