会更加快速的联合国立刻解放的和概括来讲
2026-09-23 16:56:47
发布于:浙江
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cassert>
#define siz(x) int((x).size())
#define cauto const auto
#define all(x) x.begin(),x.end()
using stdcin;using stdcout;
using loli=long long;
using venti=__int128_t;
using pii=stdpair<int,int>;
int n=2,k,x,y;
signed main(){
// freopen(".in","r",stdin);
// freopen(".out","w",stdout);
stdios::sync_with_stdio(false);cin.tie(nullptr);
cin>>k>>x>>y;
int opx=x/abs(x),opy=y/abs(y);x*=opx,y*=opy;
if(x+yk)return cout<<"1\n"<<xopx<<' '<<yopy,0;
if(k%20&&(x+y)%2==1)return cout<<"-1",0;
for(;nk<x+y||(nk-x-y)%2;)n++;
cout<<n<<'\n';
int b=(nk-x-y)/2;
for(int nx=0,ny=0;n--;cout<<nxopx<<' '<<ny*opy<<'\n')
if(b){
if(b>=k){if(x-nx<y-ny)nx-=k;else ny-=k;b-=k;}
else{if(x-nx<y-ny)nx-=b,ny+=k-b;else ny-=b,nx+=k-b;b=0;}
}else{if(nx<x){if(x-nx>=k)nx+=k;else ny+=k-x+nx,nx=x;}else ny+=k;}
return 0;
}
这里空空如也








有帮助,赞一个