Skip to content

Commit

Permalink
Adding Solution file
Browse files Browse the repository at this point in the history
  • Loading branch information
ritwiksingh21 authored Oct 8, 2020
1 parent 53471b4 commit d685dd4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Stone/Solution_Stones_C
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <stdio.h>

int main()
{
int a,b,c,ans,t;
scanf("%d", &t);
while(t--){
ans=0;
scanf("%d %d %d", &a, &b, &c);
while(b>=1 && c>=2){
b-=1; c-=2; ans+=3;
}
while(a>=1 && b>=2){
a-=1; b-=2; ans+=3;
}
printf("%d\n", ans);
}
return 0;
}

0 comments on commit d685dd4

Please sign in to comment.