Problem E The League of Sequence Designers

Problem E The League of Sequence Designers

 

 

 

 

Problem E The League of Sequence Designers

 

 

 

Problem E The League of Sequence Designers

 

 

#include <bits/stdc++.h>
#define inf 2333333333333333
#define N 1000010
#define p(a) putchar(a)
#define For(i,a,b) for(long long i=a;i<=b;++i)

using namespace std;
long long T,k,L,a,c;

void in(long long &x){
    long long y=1;char c=getchar();x=0;
    while(c<'0'||c>'9'){if(c=='-')y=-1;c=getchar();}
    while(c<='9'&&c>='0'){ x=(x<<1)+(x<<3)+c-'0';c=getchar();}
    x*=y;
}
void o(long long x){
    if(x<0){p('-');x=-x;}
    if(x>9)o(x/10);
    p(x%10+'0');
}

signed main(){
    in(T);
    while(T--){
        in(k);in(L);
        if(L>1999){
            o(-1);p('n');
            continue;
        }
        L=1999;
        For(i,1,3){
            if((k+L*i)%2==0){
                a=(k+L*i)/2;
                c=i;
                break;
            }
        }
        o(L);p('n');
        o(0);p(' ');o(-c);p(' ');
        For(i,3,L-1) o(a/(L-3)),p(' ');
        o(a%(L-3));p('n');
    }
    return 0;
}

 

原文链接: https://www.cnblogs.com/war1111/p/13255416.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍;

也有高质量的技术群,里面有嵌入式、搜广推等BAT大佬

    Problem E The League of Sequence Designers

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/363007

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年3月2日 下午2:40
下一篇 2023年3月2日 下午2:41

相关推荐