//Place your snippets for cpp here. Each snippet is defined under a snippet name and has a prefix, body and 
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
// same ids are connected.
// prefix 的格式要求是 acm-[一级标题编号].[二级标题编号][该代码片段的英文简称]
// description 的格式要求是 "插入 [该代码片段的中文名]"

{
    "求等比数列和": {
        "prefix": "acm-7.1二分",
        "body": [
            "#include<cstdio>",
            "#define R register int",
            "int n,t,px[10005],pk[10005];",
            "inline void prime_devisor(int x){",
            "\tif(x%2==0){",
            "\t\tpx[++t]=2;",
            "\t\twhile(x%2==0)pk[t]++,x/=2;",
            "\t}",
            "\tfor(R i=3;i*i<=x;i+=2){",
            "\t\tif(x%i==0){",
            "\t\t\tpx[++t]=i;",
            "\t\t\twhile(x%i==0)pk[t]++,x/=i;",
            "\t\t}",
            "\t}",
            "\tif(x!=1)px[++t]=x,pk[t]=1;",
            "}",
            "inline int sakura(){",
            "\tscanf(\"%d\",&n);",
            "\tprintf(\"%d=\",n);",
            "\tprime_devisor(n);",
            "\tfor(R i=1;i<=t;i++){",
            "\t\tprintf(\"%d^%d\",px[i],pk[i]);",
            "\t\tif(i<t)printf(\"+\");",
            "\t}",
            "}",
            "int QAQWQ=sakura();",
            "int main(){}",
            ""
        ],
        "description": "插入 求等比数列和"
    }
}