Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Fund
- {
- class Program
- {
- static void Main(string[] args)
- {
- int studentsCount = int.Parse(Console.ReadLine());
- int lecturesCount = int.Parse(Console.ReadLine());
- int initialBonus = int.Parse(Console.ReadLine());
- double maxBonus = 0;
- int maxStudentAttendances = 0;
- for (int i = 0; i < studentsCount; i++)
- {
- int attendace = int.Parse(Console.ReadLine());
- double totalBonus = attendace * 1.0 / lecturesCount * (5 + initialBonus);
- if (totalBonus > maxBonus)
- {
- maxBonus = totalBonus;
- maxStudentAttendances = attendace;
- }
- }
- Console.WriteLine($"Max Bonus: {Math.Ceiling(maxBonus)}.");
- Console.WriteLine($"The student has attended {maxStudentAttendances} lectures.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement