Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int t=0,i=0,q=0,sum=0,counter=0;
- scanf("%d",&t);
- while(t-->0)
- {
- scanf("%d",&q);
- counter=q+1;
- sum=(q*(q+1)/2);
- printf("%dn",counter);
- printf("%dn",sum);
- for(i=0;i<=q;i++)
- {
- printf("%d ",i);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement