GeeksforGeeks Solution For Hard Domain .Below You Can Find The Solution Of School Basic ,Easy ,Medium . Or Hackerrank Solution You Can Also Direct Submit Your Solution to Geeksforgeeks Same Problem .You Need to login then you can submit you answers
Problem :- Ball coloring
Submit Your Solution :- Click Here
Solution :-
#include <stdio.h>
int main()
{
int t,i;
unsigned long long int n,no;
scanf("%d",&t);
while(t--)
{
scanf("%llu",&n);
no=(n*(n-1));
printf("%llu\n",(no+2));
}
return 0;
}
Output:-
0 Comments: