Advertisement
George_Ivanov05

Problem 1. Bonus Scoring System

May 31st, 2021
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. import math
  2. import sys
  3. students = int(input())
  4. lectures = int(input())
  5. bonus = int(input())
  6. total_bonus = 0
  7. max_bonus = -sys.maxsize
  8. best_student = -sys.maxsize
  9. for i in range(students):
  10.     follow_attendances = int(input())
  11.     total_bonus = math.ceil((follow_attendances / lectures) * (5 + bonus))
  12.     if max_bonus <= total_bonus:
  13.         max_bonus = total_bonus
  14.     if best_student <= follow_attendances:
  15.         best_student = follow_attendances
  16. print(f"Max Bonus: {max_bonus}.")
  17. print(f"The student has attended {best_student} lectures.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement