提交时间:2022-08-09 11:34:15
运行 ID: 55138
#include<bits/stdc++.h> using namespace std; unsigned int SA,SB,SC; int p,A,B,T,n,k,m,a[100005],b[100005]; unsigned int rng61(){ SA^=SA<<16; SA^=SA>>5; SA^=SA<<1; unsigned int t=SA; SA=SB; SB=SC; SC^=t^SA; return SC; } void gen(){ scanf("%d%d%d%d%u%u%u%d%d",&n,&k,&m,&p,&SA,&SB,&SC,&A,&B); for(int i=1;i<=p;i++)scanf("%d%d",&a[i],&b[i]); for(int i=p+1;i<=n;i++){ a[i]=rng61()%A+1; b[i]=rng61()%B+1; } } int main(){ srand(time(NULL)),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()),srand(rand()); cin>>T; while(T--)gen(),cout<<rand()%n<<'\n'; return 0; }