Posts

Showing posts from June, 2022

Problems in your to-do list | Problem - 48 | Beginner level | C language | CodeChef

  Link to the problem statement:  https://www.codechef.com/submit/TODOLIST Solution:   #include <stdio.h> int main(void) {     int t, n, i, j; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d", &n);     int b=0, a[n];     for(j=0;j<n;j++)     {         scanf("%d", &a[j]);         if(a[j]>=1000)             b++;         else            continue;     }     printf("%d\n", b); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Course Registration | Problem - 47 | Beginner level | C language | CodeChef

  Link to the problem statement:  https://www.codechef.com/submit/COURSEREG Solution:   #include <stdio.h> int main(void) { int t, n, m, k; scanf("%d", &t); while(t--) {     scanf("%d %d %d", &n, &m, &k);     if(m-k >= n)         printf("Yes\n");     else         printf("No\n"); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Enormous Input Test | Problem - 46 | Beginner level | C language | CodeChef

  Link to the problem statement:  https://www.codechef.com/submit/INTEST Solution:   The solution is already given, you just have to click on  SUBMIT CODE  button. //We have populated the solutions for the 10 easiest problems for your support. //Click on the SUBMIT button to make a submission to this problem. #include<stdio.h> int main() { int n,k,ans=0,i; scanf("%d %d",&n,&k); for(i=0;i<n;i++) { int t; scanf("%d",&t); if(t%k==0) { ans++; } } printf("%d",ans); return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Air Hockey | Problem - 45 | Beginner level | C language | CodeChef

  Link to the problem statement:  https://www.codechef.com/submit/AIRHOCKEY Solution:   #include <stdio.h> int main(void) { int t, a, b; scanf("%d",&t); while(t--) {     scanf("%d %d", &a, &b);     if(a>b)     printf("%d\n", 7-a);     else     printf("%d\n", 7-b); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Fitness | Problem - 44 | Beginner level | C language | CodeChef

  Link to the problem statement:  https://www.codechef.com/submit/FIT Solution:   #include <stdio.h> int main(void) { int t, x; scanf("%d",&t); while(t--) {     scanf("%d", &x);     x = x*10;     printf("%d\n", x); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Biryani classes | Problem - 43 | Beginner level | C language | CodeChef

  Link to the problem statement:  https://www.codechef.com/submit/BIRYANI Solution:   #include <stdio.h> int main(void) { int t, x, y; scanf ("%d", &t); while(t--) {     scanf("%d %d", &x, &y);     x = x*y;     printf("%d\n",x); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

First and Last Digit | Problem - 42 | Beginner level | C language | CodeChef

  Link to the problem statement:  https://www.codechef.com/submit/FLOW004 Solution:   The solution is already given, you just have to click on  SUBMIT CODE  button. //We have populated the solutions for the 10 easiest problems for your support. //Click on the SUBMIT button to make a submission to this problem. #include <stdio.h> int main() {     int ld,n,t,r;          scanf("%d",&t);     while(t--){         scanf("%d",&n);         ld = n%10;         while(n>0) {r=n%10; n/=10;}         printf("%d\n",r+ld);     }     return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Credit score | Problem - 41 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit/CREDSCORE Solution:   #include <stdio.h> int main(void) { int t, i, x, y; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d %d", &x, &y);     if(x >= y*30)     printf("YES\n");     else     printf("NO\n"); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Monthly Budget | Problem - 40 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit/BUDGET_ Solution:   #include <stdio.h> int main(void) { int t, i, x, y; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d %d", &x, &y);     if(x >= y*30)     printf("YES\n");     else     printf("NO\n"); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Chef and Instant Noodles | Problem - 39 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit/INSTNOODLE Solution:   #include <stdio.h> int main(void) { int x, y; scanf("%d %d", &x, &y); x = x*y; printf("%d", x); return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Sum of Digits | Problem - 38 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit/FLOW006 Solution:   The solution is already given, you just have to click on  SUBMIT CODE  button. //We have populated the solutions for the 10 easiest problems for your support. //Click on the SUBMIT button to make a submission to this problem. #include <stdio.h> int main(void) { int t; scanf("%d",&t); while (t--){     int n,m,sum=0;     scanf ("%d",&n);     while(n>0){                  m=n%10;         n=n/10;              sum=sum+m;     }         printf("%d\n",sum); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Tyre problem | Problem - 37 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit/TYRE Solution:   #include <stdio.h> int main(void) { int t, n, m; scanf("%d", &t); while(t--) {     scanf("%d %d", &n, &m);     n = 2*n + 4*m;     printf("%d\n", n); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Expiring Bread | Problem - 36 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit/EXPIRY Solution:   #include <stdio.h> int main(void) { int t, i, n, m, k; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d %d %d", &n, &m, &k);     if(n <= (m*k))     printf("YES\n");     else     printf("NO\n"); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Lucky Four | Problem - 35 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/LUCKYFR Solution:   #include <stdio.h> int main(void) { int t, i, x, k; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d", &x);     k = 0;         while(x != 0)             {             if(x%10 == 4)                 k++;            x = x/10;         }     printf("%d\n", k); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Chairs Requirement | Problem - 34 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/CHAIRS_ Solution:   #include <stdio.h> int main(void) { int t, i, x, y; scanf("%d",&t); for(i=0;i<t;i++) {     scanf("%d %d", &x, &y);     if(x<y)     printf("0\n");     else     {     x = x - y;     printf("%d\n", x);     } } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Chef and Masks | Problem - 33 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/CMASKS Solution:   #include <stdio.h> int main(void) { int t, i, x, y; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d %d", &x, &y);     x = x*100;     y = y*10;     if(x > y || x == y)     printf("CLOTH\n");     else     printf("DISPOSABLE\n"); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Waiting Time | Problem - 32 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/WAITTIME Solution:   #include <stdio.h> int main(void) { int t, i, k, x; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d %d", &k, &x);     k = (k*7) - x;     printf("%d\n", k); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Determine the Score | Problem - 31 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/DETSCORE Solution:   #include <stdio.h> int main(void) { int t, i, x, y; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d %d", &x, &y);     x = x/10;     x = x*y;     printf("%d\n", x); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you    

Burgers | Problem - 30 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/BURGERS Solution:   #include <stdio.h> int main(void) { int t, i, a, b; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d %d", &a, &b);     if(a>b)     printf("%d\n", b);     else     printf("%d\n", a); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Ezio and Guards | Problem - 29 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/MANIPULATE Solution:   #include <stdio.h> int main(void) { int x,y,i; scanf("%d",&i); while(i--){     scanf("%d %d",&x,&y);     if(x>=y)     printf("YES\n");     else     printf("NO\n"); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you  

Fill the Bucket | Problem - 28 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/FBC Solution:   #include <stdio.h> int main(void) { int t, k, x, i; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d %d", &k, &x);     k = k - x;     printf("%d\n", k); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you

Find Remainder | Problem - 27 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/FLOW002 Solution:   The solution is already given, you just have to click on  SUBMIT CODE  button. Hope this will help you, if you want anything else leave a comment. Thank you

Football Cup | Problem - 26 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/FOOTCUP Solution:   #include <stdio.h> int main(void) {     int t, x, y, i;     scanf("%d",&t);     for(i=0;i<t;i++)     {         scanf("%d %d", &x, &y);         if(x == y && x >= 1)         {             printf("YES\n");         }         else         {             printf("NO\n");         }     }     return 0; } Hope this will help you, if you want anything else leave a comment. Thank you

ATM | Problem - 25 | Beginner level | C language | CodeChef

Image
Link to the problem statement:  https://www.codechef.com/submit-v2/HS08TEST Solution:   The solution is already given, you just have to click on SUBMIT CODE button. Hope this will help you, if you want anything else leave a comment. Thank you

Volume Control | Problem - 24 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/VOLCONTROL Solution:   #include <stdio.h> int main(void) { int t, i, x, y; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d %d", &x, &y);     if(x > y)         printf("%d\n", x-y);     else         printf("%d\n", y-x); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you

Chef and Chocolates | Problem - 23 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/CCHOCOLATES Solution:   #include <stdio.h> int main(void) { int t, x, y, z, i; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d %d %d", &x, &y, &z);     x = x*5;     y = y*10;     z = (x + y) / z;     printf("%d\n", z); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you

Rating Improvement | Problem - 22 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/ADVANCE Solution:   #include <stdio.h> int main(void) { int t, x, y, i; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d %d", &x, &y);     if(  y >= x && y <= (x+200))     printf("YES\n");     else     printf("NO\n"); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you

Chef and Brain Speed | Problem - 21 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/CBSPEED Solution:   #include <stdio.h> int main(void) { int x, y; scanf("%d %d", &x, &y); if(y > x) printf("YES"); else printf("NO"); return 0; } Hope this will help you, if you want anything else leave a comment. Thank you

Equal Distribution | Problem - 20 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/EQUALDIST Solution:   #include <stdio.h> int main(void) { int t, a, b, i; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d %d", &a, &b);     a = ( a + b ) % 2;     if(a == 0)     printf("YES\n");     else     printf("NO\n"); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you

Age Limit | Problem - 19 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/AGELIMIT Solution:   #include <stdio.h> int main(void) { int t, a, x, y, i; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d %d %d", &x, &y, &a);     if(a>=x && a<y)         printf("YES\n");    else         printf("NO\n"); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you

The Cheaper Cab | Problem - 18 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/CABS Solution:   #include <stdio.h> int main(void) { int t, x, y, i; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d %d", &x, &y);     if( x < y )         printf("FIRST\n");    else if( y < x )         printf("SECOND\n");    else if( x = y )         printf("ANY\n"); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you

Six Friends | Problem - 17 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/SIXFRIENDS Solution:   #include <stdio.h> int main(void) { int t, x, y, i; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d %d", &x, &y);     x = x * 3;     y = y * 2;     if( x > y )         printf("%d\n", y);    else         printf("%d\n", x); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you

Email Reminders | Problem - 16 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/EMAILREM Solution:   #include <stdio.h> int main(void) { int n, u; scanf("%d %d", &n, &u); u = n - u; printf("%d", u); return 0; } Hope this will help you, if you want anything else leave a comment. Thank you

Chef gives Party | Problem - 15 | Beginner level | C language | CodeChef

Link to the problem statement:  https://www.codechef.com/submit-v2/PARTY2 Solution:   #include <stdio.h> int main(void) { int t, n, x, k, i; scanf("%d", &t); for(i=0;i<t;i++) {     scanf("%d %d %d", &n, &x, &k);     x = n * x;     if(k >= x)     printf("YES\n");     else     printf("NO\n"); } return 0; } Hope this will help you, if you want anything else leave a comment. Thank you