Practice makes us perfect solution codechef

Practice makes us perfect solution codechef

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 1010 problems every week for 44 weeks.

Given the number of problems he actually solved in each week over 44 weeks as P1,P2,P3,P1,P2,P3, and P4P4, output the number of weeks in which Chef met his target.

Input Format

There is a single line of input, with 44 integers P1,P2,P3,P1,P2,P3, and P4P4. These are the number of problems solved by Chef in each of the 44 weeks.

Output Format

Output a single integer in a single line – the number of weeks in which Chef solved at least 1010 problems.

Practice makes us perfect solution codechef

  • 1P1,P2,P3,P41001≤P1,P2,P3,P4≤100

Sample Input 1 

12 15 8 10

Sample Output 1 

3

Explanation

Chef solved at least 1010 problems in the first, second and fourth weeks. He failed to solve at least 1010 problems in the third week. Hence, the number of weeks in which Chef met his target is 33.

Through this contest, selected students get access to a free 6 month LinkedIn Premium subscription which helps students:

  • Discover & apply to 20M+ jobs/internships on LinkedIn
  • Reach out to hiring managers/recruiters/mentors directly
  • Find career paths that people similar to them have taken
  • Learn from over 17K expert-led LinkedIn Learning courses (technical & soft-skills) with certificates

Sample Input 2 

2 3 1 10

Sample Output 2 

1

Practice makes us perfect solution codechef

Chef solved at least 1010 problems in the fourth week. He failed to solve at least 1010 problems in all the other three weeks. Hence, the number of weeks in which Chef met his target is 11.

Sample Input 3 

12 100 99 11

Sample Output 3 

4

Explanation

Chef solved at least 1010 problems in all the four weeks. Hence, the number of weeks in which Chef met his target is 44.

Sample Input 4

Practice makes us perfect solution codechef

1 1 1 1

Sample Output 4 

0

Explanation

Chef was not able to solve at least 1010 problems in any of the four weeks. Hence, the number of weeks in which Chef met his target is 00.

SOLUTION

Click here

Practice makes us perfect solution codechef is one of the most asked coding question. This question is repeated in almost every company paper and if you are ready to crack the interviews and the question papers then you must check our website on daily purpose so that you can get the answer of the latest question “Practice makes us perfect solution codechef”.

Leave a Comment