К моменту завершения K-го урока пройдёт K собственно уроков и (K - 1) перемена. Вычисляем продолжительность в минутах, делим с остатком на 60 - число минут в часе - и получаем количество часов и минут, которые пройдут с начала занятий. Остаётся прибавить к этому 8 часов - время начала занятий - и вывести ответ.
python 3:
MINS_IN_HOUR = 60
mins_in_class, mins_in_break = 45, 5
start_hour = 8
k = int(input())
total_mins = k * mins_in_class + (k - 1) * mins_in_break
hour, mins = divmod(total_mins, MINS_IN_HOUR)
print(hour + start_hour, mins)
Код:
using System;namespace ThisAnswerIsNotMine { class Program { private static int a; private static int b; private static int c; private static int d; private static void Main() { int.TryParse(Console.ReadLine()!, out a); int.TryParse(Console.ReadLine()!, out b); int.TryParse(Console.ReadLine()!, out c); int.TryParse(Console.ReadLine()!, out d); Console.WriteLine((a / c) * (b / d) >= (b / c) * (a / d) ? "Широкая" : "Узкая"); } }}
Program n1;
Uses CRT;
Const n=20;
Var m: array[1..n] of integer;
i,a,s,b: integer;
begin
ClrScr;
Randomize;
For i:=1 to n do
begin
m[i]:=random(50);
write(m[i]:3);
end;
writeln;
writeln('Введите A и B');
readln(a,b);
For i:=a to b do
s:=s+m[i];
writeln('Сумма равна ',s);
readln
end.