Subscribe Us

Responsive Advertisement

Advertisement

1651B Prove Him Wrong codeforces solution in cpp

 

1651B Prove Him Wrong codeforces solution in cpp

by ujjal roy




#include<bits/stdc++.h>

using namespace std;

main()

{

    int t,n,i,c;

    cin>>t;

    while(t--)

    {

        cin>>n;

        if(n>19) cout<<"NO"<<endl;

        else

        {

            cout<<"YES"<<endl;

            c=1;

            for(i=1;i<=n;i++)

            {

                cout<<c<<" ";

                c*=3;

            }

            cout<<endl;

        }

    }



    return 0;

}


Post a Comment

0 Comments