Hello World Lab 3
NOTE: Some exercises below may be collected from an interview with big tech companies, like FAANG (Facebook, Amazon, Apple, Netflix, Google) and others like Microsoft, etc. Be sure to have a try!
Questions
1. Day of the week
An integer K in the range 1 to 365 is given. If the first day of the year is Thursday, which day is K?
The days within a week are numbered as: 0 stands for Sunday, 1 — Monday, 2 — Tuesday, ..., 6 — Saturday.
Return the output as a number described above.
Example: Input: 2 (2nd day of the year is Jan 2). Output: 5 (Friday).
2. Hours and minutes past midnight
Given the integer N - the number of minutes that have passed since midnight. What numbers are displayed on the 24h digital clock?
The program should print two numbers: the number of hours (0-23) and the number of minutes (0-59).
Example: If N = 150, then 150 minutes have passed since midnight and it is now 2:30 am. So the program should print 2 30.
>>> 150 # input
2 30 # output3. Between timestamps
Receive two inputs as two timestamps of the same day. The timestamps should have the following information: hours, minutes and seconds for both of the timestamps. The first timestamp happened before the second one. Calculate how many seconds have passed between two timestamps.
Example #1:
>>> 1 # input hour of event 1
>>> 1 # input minute of event 1
>>> 1 # input second of event 1
# Event 1 happens at 01:01:01 (1 hour, 1 minute, 1 second)
>>> 2 # input hour of event 2
>>> 2 # input minute of event 2
>>> 2 # input second of event 2
# Event 2 happens at 02:02:02 (2 hours, 2 minutes, 2 seconds)
3661 # output number of seconds between event 1 and event 2Example #2:
>>> 1 # input hour of event 1
>>> 2 # input minute of event 1
>>> 30 # input second of event 1
# Event 1 happens at 01:02:30 (1 hour, 2 minutes, 30 seconds)
>>> 1 # input hour of event 2
>>> 3 # input minute of event 2
>>> 20 # input second of event 2
# Event 2 happens at 01:03:20 (1 hour, 3 minutes, 20 seconds)
50 # output number of seconds between event 1 and event 24. Clock hand angle
Since midnight, the hour hand of an analog clock has turned x degrees. When the hour hand is at x degrees, at which degree is the minute hand at?
Hint: How many rotations has the minute hand made if the hour hand has made one full rotation?
Example: When the hour hand makes a 190 degrees angle since midnight, the minute hand will make a 120 degrees angle.

Example:
>>> 240 # input
0 # output>>> 255 # input
180 # output5. Classroom desks
A school decided to replace the desks in three classrooms. Each desk sits two students. Given the number of students in each class, print the smallest possible number of desks that can be purchased.
The program should read three integers: the number of students in each of the three classes, a, b and c respectively.
Example: In the first test there are three groups. The first group has 20 students and thus needs 10 desks. The second group has 21 students, so they can get by with no fewer than 11 desks. 11 desks is also enough for the third group of 22 students. So we need 32 desks in total.
>>> 20 # input a
>>> 21 # input b
>>> 22 # input c
32 # output