求助: 今天C题为什么只有10分
  • 板块灌水区
  • 楼主V1mnkE
  • 当前回复9
  • 已保存回复9
  • 发布时间2022/8/7 17:12
  • 上次更新2023/10/27 16:35:59
查看原帖
求助: 今天C题为什么只有10分
477757
V1mnkE楼主2022/8/7 17:12

rt

#include<bits/stdc++.h>
#define int long long
using namespace std;
int t,s,m;
int read(){
    int s=0,f=1;
	char ch=getchar();
    while(ch<'0'||ch>'9'){
            if(ch=='-') f=-1;
            	ch=getchar();
            }
            while(ch>='0'&&ch<='9'){
                 s=s*10+ch-'0';
                 ch=getchar();
            }
    return s*f;
}
inline void write(int x){
    static char buf[20];
    static int len=-1;
    if(x<0)putchar('-'),x=-x;
    do buf[++len]=x%10,x/=10;while(x);
    while(len>=0)putchar(buf[len--]+'0');
    putchar(' ');
}
signed main(){
	t=read();
	while(t--){
		s=read(),m=read();
		if(s&1||m==1)puts("-1");
		else {
			write(2);
			write(s>>1);
			write(s>>1);
			puts("");	
		}
	}
	return 0;
}
2022/8/7 17:12
加载中...