zoukankan      html  css  js  c++  java
  • CF476D Dreamoon and Sets

    Jisoo

    观察样例,知道肯定和六有关系

    并且\(gcd(a,b)=gcd(b,a-b)\)

    就可以构造了

    #include<cstdio>
    #include<iostream>
    #include<cstring>
    #include<iomanip>
    #include<cmath>
    #include<stack>
    #include<algorithm>
    using namespace std;
    template<class T>inline void read(T &x)
    {
        x=0;register char c=getchar();register bool f=0;
        while(!isdigit(c))f^=c=='-',c=getchar();
        while(isdigit(c))x=(x<<3)+(x<<1)+(c^48),c=getchar();
        if(f)x=-x;
    }
    template<class T>inline void print(T x)
    {
        if(x<0)putchar('-'),x=-x;
        if(x>9)print(x/10);
        putchar('0'+x%10);
    }
    int n,k;
    int main(){
    	read(n);
    	read(k);
    	printf("%d\n",(n*6-1)*k);
    	for(int i=0;i<n;++i){
    		printf("%d %d %d %d\n",(6*i+1)*k,(6*i+2)*k,(6*i+3)*k,(6*i+5)*k);
    	}
    	return 0;
    }
    
  • 相关阅读:
    HttpWebRequest后台读取网页类
    MD5加密方法
    Base64封装类
    3DES封装类
    C#操作XML类
    XML_Qt_资料
    XML_CPP_资料
    h.264_javascript_资料
    ffmpeg_资料_01
    QWebEngineView_简单例子_01
  • 原文地址:https://www.cnblogs.com/For-Miku/p/15515911.html
Copyright © 2011-2022 走看看