Algorithm
problem Link : https://www.codechef.com/problems/PRACTICEPERF
Problem
Most programmers will tell you that one of the ways to improve your performance in competitive programming is to practice a lot of problems.
Our Chef took the above advice very seriously and decided to set a target for himself.
- Chef decides to solve at least problems every week for weeks.
Given the number of problems he actually solved in each week over weeks as and , output the number of weeks in which Chef met his target.
Input Format
There is a single line of input, with integers and . These are the number of problems solved by Chef in each of the weeks.
Output Format
Output a single integer in a single line - the number of weeks in which Chef solved at least problems.
Constraints
Sample 1:
12 15 8 10
3
Explanation:
Chef solved at least problems in the first, second and fourth weeks. He failed to solve at least problems in the third week. Hence, the number of weeks in which Chef met his target is .
Code Examples
#1 Code Example with C Programming
Code -
C Programming
#include<stdio.h>
int main()
{
int i,w[4],count=0;
for(i=0;i < 4;i++)
{
scanf("%d",&w[i]);
if(w[i]>=10) count++;
}
printf("%d",count);
}
Copy The Code &
Try With Live Editor
Input
Output
Demonstration
CodeChef solution in PRACTICEPERF - Practice makes us perfect Codechef solution in C,C++