-
Uva 10302 Summation of Polynomials Solution – Nazran Khondokar
Solution: #include<stdio.h> int main() { long long int n, i, sum, multi; while(scanf("%lld",&n)==1) { if(n<0) { sum=0; for(i=n+1; i<0;i++) { sum=sum+i; } multi=sum*sum; printf("%lld\n",multi); } if(...
-
12372 – Packing for Holiday – Nazran Khondokar
#include<stdio.h> int main() { int i, l, w, h, n; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d%d%d",&l,&w,&h); if(l>20||w>20||h>20) { printf("Case %d: bad\n",i); } else { printf("Case %d: good\n"...
-
UVa 10783 Odd Sum Solution – Nazran Khondokar
#include<stdio.h> int main() { int t, u, i, a, b, sum; scanf("%d",&t); if(t>=1 && t<=100) { for(u=1; u<=t; u++) { sum=0; scanf("%d%d", &a, &b); if((a>=0 && a<=100) && (b<=100 && b>=0)) { if((a%2)=...
-
UVa 11150 – Cola Solution – Nazran Khondokar
#include<stdio.h> int main() { int c, i, sum; while(scanf("%d",&c)==1) { if(c>=1&&c<=200) { sum=0; for(i=1; i<=c; i++) { if((i%2)!=0) { sum=1+sum; } if((i%2)==0) { sum=2+sum; } } } printf("%d\n",s...
-
UVa 10696 f91 Solution – Nazran Khondokar
#include<stdio.h> int main() { long long int n, t, u, v, w, x, y, i, p; for(i=1; i<=250000; i++) { scanf("%lld",&n); if(n==0) { break; } p=n; if(n<=100) { b: t=n+11; if(t<=100) { u=t+11; if(u<=100...
-
UVa 11727 Cost Cutting Solution – Nazran Khondokar
#include<stdio.h> int main() { int T, x, y, z, i; scanf("%d",&T); if(T>=1&&T<=20) { for(i=1; i<=T; i++) { scanf("%d%d%d",&x,&y,&z); if((x>=1000&&x<=10000)&&(y>=1000&&y<=10000)&&(z>=1000&&z<=10000)) { ...