Kid lost his focus

0

0 votes
Easy-Medium
Problem

After wasting too much time trying out on girls in the valentine month, Yash pretty much lost his grip on the course and studies. As a result, his Mid term exams went bad.

Now, Yash has to cover up his marks from the remaining CA and the end term. Two CAs and the Mid terms are over. He is left with third CA and the end terms to save himself from a Re-appear.

To make up his mind for studying, he has to figure out how much marks he needs to pass. Yash's strategy is to pass(40%) separately in CA's and term exams. Overall, he'll naturally pass then.

Ignoring the weightage of exams, calculate remaining CA marks and term marks separately to make them reach 40%.

If total marks in all three CA's fail to make it to 40%, add 10 marks to end term required marks. All CAs and Term exams are counted

CONSTRAINTS

  • 1 <= S <= 100000
  • 0 <= CA1 <= 30
  • 0 <= CA2 <= 30
  • 0 <= CA3 <= 30
  • 0 <= MT1 <= 40
  • 0 <= ET1 <= 70

INPUT

  • S subjects.
  • CA1 CA2 MT1 marks in each line of input, for each subject.

OUTPUT

  • CA3 ET1 marks to be obtained in CA3 and End Term exams, for each subject.
Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?