Statistics

Problem Statement for "SuperWatch"

Problem Statement

Year 3001. Your company needs to know if new model of watch is precise enough, so you need to run a small experiment. You'll take several watches, set them to "00:00", wait for a couple of years and then compute the watch imprecision which is equal to the largest difference between the two times shown on the watches. For example, if you've taken four watches and at the end of the experiment they've shown "11:11", "10:59", "11:02" and "11:13", then the biggest difference is 14 minutes (between "11:13" and "10:59").

To make the experiment a bit more interesting you've decided to give the watches to volunteers living in different time zones. The time zones have positive 0-based indices, so time zone number K is K hours ahead of yours. For example, 2:15 in your zone, 4:15 in zone 2 and 8:15 in zone 6 are the same moment of time. The watches of the volunteers were set according to the time zones they are from, so the watch for the volunteer from time zone X was set to X hours zero minutes at the beginning of the experiment. Before the start of the experiment you wrote down the time zones your volunteers are from, and at the end of the experiment each of the volunteers recorded the time shown on his watch. Unfortunately, you messed up the order of the records, so now you do not know which time zone corresponds to which volunteer. You are optimistic so you want to find the minimal possible imprecision under given data. Please note that the watches does not show date, so, for example, the difference between "23:50" and "00:10" can be only 20 minutes (or 23 hours and 40 minutes, if needed).

You will be given a String[] times, giving you the times recorded by volunteers. Each element of times is formatted as "HH:MM" (quotes for clarity), where HH is an hour between 00 and 23 and MM is a minute between 00 and 59. You will be also given a int[] zones, giving you the time zones for the volunteers. You are to assign each time zone to exactly one volunteer and return the minimal watch imprecision in minutes.

Definition

Class:
SuperWatch
Method:
smallestImprecision
Parameters:
String[], int[]
Returns:
int
Method signature:
int smallestImprecision(String[] times, int[] zones)
(be sure your method is public)

Constraints

  • times will contain between 2 and 40 elements, inclusive.
  • zones will contain the same number of elements as times.
  • Each element of times will be formatted as "HH:MM", where HH is a 2-digit integer between 00 and 23, inclusive, and MM is a 2-digit integer between 00 and 59, inclusive.
  • Each element of zones will be between 0 and 23, inclusive.

Examples

  1. {"16:11", "15:59", "16:02", "16:13"}

    {5, 5, 5, 5}

    Returns: 14

    The example from the problem statement, but all watches got a 5 hours time shift.

  2. {"12:11", "13:59", "19:02", "18:13"}

    {1, 3, 7, 8}

    Returns: 14

    Assign zone 1 to watch 1, zone 3 to watch 2, zone 7 to watch 4 and zone 8 to watch 3 to achieve the same imprecision of 14 minutes.

  3. {"23:59", "00:02", "12:00", "08:01"}

    {0, 0, 8, 12}

    Returns: 3

    It is near midnight now. The first two watches are in your zone, while the third and the fourth are offset by 12 and 8 hours, respectively.

  4. {"13:23", "11:54", "00:03", "22:22", "10:38"}

    {1, 4, 13, 21, 13}

    Returns: 256

  5. {"00:00", "00:00", "00:00", "00:00", "00:00", "00:00", "00:00"}

    {3, 5, 7, 9, 11, 13, 15}

    Returns: 720

  6. { "10:20", "02:06", "12:12", "17:32", "14:13", "14:32", "10:45", "09:43", "06:23", "08:14", "15:10", "10:37", "17:35", "05:22", "12:17", "21:24", "15:07", "10:33", "18:09", "04:59", "03:13", "06:30", "23:33", "04:28", "10:13", "02:19", "05:34", "18:17", "19:10", "09:50", "08:12", "15:50", "14:33", "10:50", "06:21", "06:16", "23:40", "11:39", "22:52", "18:52"}

    {12, 17, 2, 11, 17, 11, 1, 14, 13, 4, 16, 0, 14, 23, 14, 17, 6, 14, 16, 8, 19, 0, 10, 14, 18, 21, 8, 22, 1, 8, 10, 16, 16, 3, 13, 20, 19, 9, 4, 4}

    Returns: 198

  7. {"05:31", "19:57", "23:51", "16:31", "12:29", "02:38", "13:04", "08:46", "18:56", "21:31", "22:25", "08:38", "09:03", "20:05", "00:33", "11:50", "02:11", "04:48", "09:06", "13:12", "12:46", "23:55", "21:59", "13:45", "11:01", "00:43", "06:42", "11:54", "03:54", "05:19", "11:38", "00:24", "12:10", "21:13", "03:01", "02:24", "12:20", "02:07", "17:27", "07:43"}

    {3, 3, 22, 3, 15, 21, 22, 15, 0, 0, 15, 19, 13, 18, 12, 4, 6, 20, 4, 1, 1, 1, 10, 12, 11, 22, 15, 12, 13, 7, 17, 15, 5, 3, 18, 20, 5, 13, 0, 6}

    Returns: 180

  8. { "19:02", "05:42", "06:37", "22:36", "04:55", "23:17", "21:39", "16:31", "08:31", "21:15", "03:35", "07:55", "11:38", "09:50", "12:53", "04:54", "05:40", "00:41", "12:00", "07:30", "17:47", "07:40", "18:55", "05:53", "11:18", "00:01", "15:40", "17:26", "23:03", "21:00", "22:03", "12:34", "15:46", "01:31", "03:23", "06:00", "11:27", "04:31", "06:49", "12:45"}

    {8, 23, 7, 21, 20, 9, 17, 6, 20, 21, 2, 1, 1, 15, 7, 14, 6, 9, 8, 10, 7, 7, 4, 4, 0, 4, 6, 23, 23, 21, 19, 14, 20, 10, 4, 12, 11, 4, 1, 5}

    Returns: 247

  9. {"11:01","18:22","03:32","20:03","07:03"}

    {5,5,7,7,10}

    Returns: 699

  10. {"01:34","22:56","00:41"}

    {2,11,19}

    Returns: 742

  11. {"14:17","16:26","12:45","02:20","22:36","19:29","14:24","11:10","05:23","21:20","15:17","19:45","18:24","15:11","12:31","00:49","01:02","21:58","22:52","17:37","21:28","19:55","05:26","16:05","12:34","23:51","04:18","17:02","00:57","04:53","02:41","19:47","10:14","19:01","21:33","03:39","15:24","17:06","14:08"}

    {6,13,19,13,5,17,9,5,21,8,17,11,13,10,22,7,7,4,23,20,5,18,1,1,5,1,18,20,16,14,9,22,16,23,12,15,23,4,17}

    Returns: 308

  12. {"00:18","11:16","04:02","00:31","19:37","01:30","21:50","03:08","00:33","01:33","00:28","00:00","00:00","05:55","18:42","00:00","12:03","17:06","03:38","00:23","01:11","09:00","20:51","00:12","04:03","02:03","01:11","00:28","05:01","03:36","00:31","13:19","08:34","00:20","05:00","09:00","00:43","00:01","06:00"}

    {17,0,8,1,8,0,0,1,15,14,0,9,9,22,14,20,4,3,9,0,1,2,15,2,19,16,0,0,7,0,19,9,0,17,4,20,22,5,2}

    Returns: 425

  13. { "00:00", "08:00", "16:00" }

    { 0, 0, 0 }

    Returns: 960

  14. {"00:01", "23:00", "23:02"}

    {0, 1, 23}

    Returns: 59

  15. { "03:39", "17:55", "06:08", "01:26", "07:55", "00:00", "14:14", "11:12", "17:07", "17:29", "23:15", "16:03", "15:49", "21:56", "14:26", "03:00"}

    {15, 20, 13, 3, 12, 1, 6, 1, 11, 3, 13, 4, 5, 14, 23, 21}

    Returns: 198

  16. { "04:25", "03:49", "12:54", "02:10", "02:19", "15:58", "22:52", "16:23", "17:44", "09:09", "01:05", "06:50", "05:26", "02:32", "10:57", "06:02", "19:18", "17:04", "23:05", "13:03", "04:48", "02:06", "02:57", "04:35", "19:23", "00:01", "06:20"}

    {12, 19, 18, 4, 20, 2, 8, 4, 8, 13, 17, 2, 2, 6, 6, 16, 14, 12, 7, 12, 11, 4, 11, 4, 14, 1, 6}

    Returns: 306

  17. { "18:17", "04:09", "14:58", "02:44", "14:56", "10:18", "15:18", "23:21", "10:13", "07:00", "10:38", "22:45", "02:08", "07:26"}

    {0, 6, 18, 5, 10, 5, 7, 9, 19, 9, 22, 9, 10, 12}

    Returns: 420

  18. { "08:59", "05:51", "20:12", "11:31", "04:13", "23:04", "02:27", "20:35", "09:08", "05:48", "10:15", "08:55", "07:17", "02:48", "11:18", "09:31", "05:03", "09:39", "07:50"}

    {22, 23, 15, 8, 3, 21, 9, 18, 14, 23, 22, 15, 16, 13, 6, 19, 4, 17, 14}

    Returns: 408

  19. { "12:37", "19:29", "17:45", "18:11", "07:05", "17:22", "20:58", "19:58", "12:07", "14:56", "17:58"}

    {7, 22, 20, 2, 13, 21, 18, 18, 9, 12, 11}

    Returns: 384

  20. { "04:25", "17:14", "01:49", "14:58", "12:11", "17:42", "15:54", "04:02", "07:19", "21:11", "04:44", "14:08"}

    {4, 11, 13, 7, 11, 10, 13, 14, 16, 5, 23, 5}

    Returns: 346

  21. { "13:44", "08:54", "14:03", "02:54", "18:46", "01:18", "05:00", "12:23", "15:52", "13:24", "04:00", "06:28", "19:20", "08:09", "04:03", "11:34", "03:01", "08:21", "09:19", "10:19", "09:51", "02:57", "16:04", "18:10", "13:07", "09:31", "17:29", "13:27", "08:18", "15:51", "13:38", "16:29", "20:03", "02:26", "00:58", "17:41", "21:27"}

    {8, 5, 8, 12, 7, 18, 10, 9, 10, 11, 3, 23, 22, 5, 3, 0, 12, 12, 4, 12, 0, 5, 12, 22, 11, 6, 15, 4, 20, 5, 9, 20, 13, 12, 0, 16, 17}

    Returns: 221

  22. { "22:44", "01:52", "07:07", "16:17", "18:47", "03:11", "04:29", "13:28", "05:10", "18:34", "10:29", "11:13", "19:58", "08:22", "01:44", "08:07", "22:51", "08:02", "16:18", "06:30", "03:51", "08:25", "18:21", "22:48", "10:53", "09:41", "03:42", "06:07", "04:55", "11:13", "02:18", "05:44", "13:14", "20:07", "23:02", "11:29", "09:45"}

    {15, 22, 19, 19, 4, 19, 16, 22, 23, 20, 4, 23, 3, 8, 3, 19, 3, 8, 8, 17, 1, 10, 22, 22, 1, 18, 6, 12, 21, 18, 6, 17, 21, 1, 10, 12, 2}

    Returns: 226

  23. { "18:16", "03:36", "23:30", "06:24", "08:59", "13:18", "20:35", "14:31", "11:03", "22:12", "23:06", "10:20", "07:44", "00:36", "11:05", "04:22", "01:44", "15:40", "21:46", "01:51", "08:31", "07:16", "00:24", "16:50", "13:14", "01:34", "11:22", "00:17", "11:18", "06:24", "12:41", "22:22", "15:39", "18:11", "08:04", "04:08", "08:52", "18:47", "15:39"}

    {3, 12, 7, 22, 22, 15, 4, 6, 17, 14, 16, 10, 23, 15, 19, 17, 19, 15, 15, 6, 1, 9, 17, 8, 20, 18, 20, 4, 18, 2, 15, 17, 11, 10, 15, 16, 0, 12, 23}

    Returns: 262

  24. { "19:47", "08:39", "08:29", "02:28", "22:14", "04:44", "11:10", "09:29", "03:47", "05:55", "10:47", "02:41", "22:23", "23:17", "07:15", "14:15", "20:16", "08:18", "11:48", "08:16", "21:28", "00:40", "12:50", "12:01", "09:06", "17:05", "22:32", "17:25", "13:11", "07:20", "03:12", "09:20", "13:07", "15:20", "13:27", "06:20", "17:49", "01:51", "00:01"}

    {20, 7, 2, 21, 22, 16, 3, 17, 20, 22, 11, 17, 12, 5, 5, 23, 12, 23, 18, 7, 7, 1, 9, 23, 1, 20, 6, 4, 8, 14, 12, 16, 15, 9, 0, 0, 15, 20, 4}

    Returns: 185

  25. { "13:00", "19:06", "00:08", "14:19", "17:58", "01:18", "05:24", "02:48", "22:39", "15:02", "14:23", "02:55", "11:08", "03:25", "17:25", "07:20", "13:27", "15:10", "13:09", "19:01", "21:47", "05:23", "20:21", "19:05", "05:42", "20:40", "01:06", "11:08", "02:26", "09:10", "19:07", "21:06", "03:18", "07:06", "08:38", "02:59", "00:43"}

    {7, 22, 10, 4, 6, 6, 19, 10, 16, 16, 21, 12, 16, 23, 18, 14, 15, 12, 22, 17, 23, 23, 2, 16, 7, 4, 5, 2, 13, 4, 21, 12, 11, 15, 19, 10, 8}

    Returns: 186

  26. { "18:42", "12:16", "22:07", "08:46", "04:45", "21:34", "03:53", "10:55", "20:01", "07:48", "03:22", "01:41", "16:04", "06:59", "06:15", "09:42", "08:28", "11:16", "11:23", "07:34", "12:11", "23:07", "22:48", "00:57", "15:03", "15:37", "09:29", "14:47", "08:59", "16:34", "13:50", "20:58", "14:00", "09:11", "23:33", "07:03", "09:57", "05:17", "21:50", "13:57"}

    {14, 22, 8, 8, 8, 8, 23, 4, 17, 16, 23, 17, 10, 10, 16, 14, 1, 19, 10, 19, 23, 2, 21, 21, 17, 22, 19, 13, 21, 9, 12, 22, 11, 18, 22, 5, 21, 17, 23, 19}

    Returns: 211

  27. { "17:22", "09:17", "16:42", "13:13", "03:51", "06:39", "20:27", "14:51", "06:41", "09:37", "18:05", "11:27", "06:20", "20:39", "11:33", "09:07", "17:38", "15:34", "09:41", "14:41", "14:58", "01:44", "17:42", "22:12", "16:02", "22:08", "19:26", "02:16", "11:37", "23:14", "22:18", "16:29", "11:13", "08:33", "14:40", "00:44"}

    {1, 14, 11, 3, 8, 13, 11, 4, 7, 16, 15, 20, 10, 8, 4, 18, 0, 1, 13, 3, 5, 9, 8, 5, 3, 0, 6, 2, 21, 18, 23, 3, 15, 18, 16, 18}

    Returns: 262

  28. { "02:21", "06:12", "00:56", "04:11", "13:17", "03:50", "07:09", "04:42", "20:31", "14:45", "23:42", "15:44", "15:47", "12:05", "05:08", "11:17", "07:01", "01:00", "06:57", "05:12", "08:37", "15:37", "03:12", "07:38", "15:47", "14:42", "15:08", "19:29", "12:35", "20:09", "21:57", "22:10", "14:09", "12:34", "20:22", "16:23", "03:22", "17:22", "21:48", "09:09"}

    {23, 0, 17, 21, 9, 9, 3, 6, 17, 2, 12, 5, 13, 18, 4, 15, 19, 21, 3, 12, 15, 15, 18, 23, 9, 11, 11, 10, 15, 10, 22, 22, 22, 7, 10, 23, 1, 7, 12, 6}

    Returns: 179

  29. { "06:21", "16:57", "15:05", "18:36", "11:40", "02:32", "07:29", "05:49", "19:55", "08:17", "12:14", "18:40", "05:29", "12:40", "01:14", "23:27", "00:29", "18:25", "12:28", "07:16", "06:56", "09:33", "18:56", "04:56", "04:46", "01:01", "13:32", "21:55", "14:01", "13:32", "15:18", "07:18", "21:41", "00:59", "22:31", "14:03", "18:22"}

    {1, 11, 8, 9, 11, 12, 1, 0, 16, 11, 22, 16, 12, 8, 1, 9, 8, 9, 18, 13, 1, 15, 9, 21, 13, 21, 10, 18, 18, 2, 2, 0, 5, 21, 4, 7, 4}

    Returns: 204

  30. { "19:33", "22:30", "20:11", "06:27", "08:18", "09:37", "11:43", "00:56", "17:18", "14:16", "10:05", "12:54", "12:22", "20:16", "15:04", "06:57", "17:06", "22:06", "17:58", "14:18", "01:50", "07:33", "05:26", "11:22", "17:26", "14:27", "15:37", "19:46", "04:19", "03:54", "04:23", "08:06", "12:50", "15:58", "06:37", "04:28", "02:37", "15:06", "07:26"}

    {5, 8, 9, 17, 2, 8, 12, 3, 1, 18, 22, 20, 6, 10, 11, 1, 2, 5, 18, 18, 22, 13, 13, 23, 3, 20, 14, 14, 6, 12, 12, 15, 1, 8, 21, 20, 12, 19, 21}

    Returns: 211

  31. { "03:45", "10:17", "17:47", "22:38", "16:06", "08:34", "16:14", "06:05", "22:40", "18:35", "18:37", "08:49", "04:05", "10:14", "19:35", "06:41", "20:29", "00:40", "03:57", "09:42", "01:31", "04:39", "19:46", "17:44", "18:46", "00:30", "20:49", "03:51", "23:29", "16:12", "05:50", "18:15", "01:09", "03:40", "20:52"}

    {8, 7, 19, 7, 9, 2, 17, 16, 11, 13, 21, 11, 4, 0, 0, 8, 19, 0, 13, 1, 1, 17, 13, 21, 8, 8, 14, 23, 6, 20, 23, 5, 13, 13, 10}

    Returns: 295

  32. { "21:47", "01:41", "20:21", "19:31", "23:08", "04:19", "00:10", "13:09", "16:06", "17:39", "09:35", "10:37", "09:25", "08:30", "16:59", "16:43", "18:33", "09:28", "16:52", "10:12", "17:20", "14:56", "15:39", "02:57", "04:49", "05:57", "10:56", "14:49", "17:45", "04:09", "04:28", "14:04", "05:26", "11:50", "07:09"}

    {11, 0, 2, 22, 5, 23, 16, 10, 18, 9, 14, 14, 14, 5, 7, 5, 7, 1, 10, 16, 5, 23, 12, 15, 2, 2, 16, 23, 19, 12, 11, 20, 4, 13, 20}

    Returns: 214

  33. { "10:44", "05:26", "23:08", "04:59", "18:35", "19:53", "14:20", "14:32", "16:33", "19:51", "02:09", "11:42", "18:05", "01:00", "14:37", "06:52", "06:03", "23:42", "05:09", "20:57", "14:43", "13:52", "15:01", "03:53", "04:55", "08:23", "03:56", "20:32", "16:28", "21:27", "05:16", "02:45", "15:37", "04:07", "15:37", "17:32", "03:23"}

    {23, 0, 9, 7, 10, 19, 15, 9, 10, 17, 2, 3, 3, 12, 2, 10, 18, 9, 14, 2, 17, 17, 9, 9, 16, 11, 16, 1, 17, 14, 14, 15, 13, 21, 15, 1, 23}

    Returns: 300

  34. { "05:29", "13:18", "20:47", "23:47", "13:42", "22:09", "22:58", "05:08", "05:23", "12:44", "20:37", "02:39", "19:03", "03:21", "07:08", "20:02", "09:49", "03:32", "18:06", "12:33", "02:48", "22:03", "16:39", "21:35", "19:38", "00:44", "22:40", "02:18", "02:58", "22:04", "14:59", "03:42", "02:51", "07:51", "09:41", "00:30", "05:44", "13:36"}

    {4, 5, 4, 4, 23, 15, 12, 15, 12, 8, 2, 11, 9, 16, 18, 11, 9, 17, 19, 8, 12, 14, 21, 19, 14, 0, 22, 8, 9, 22, 15, 3, 6, 0, 22, 9, 15, 8}

    Returns: 210

  35. { "08:18", "23:18", "12:39", "11:42", "20:45", "17:10", "18:50", "17:57", "04:06", "03:33", "12:50", "17:36", "03:19", "00:36", "14:32", "22:16", "01:46", "05:59", "07:38", "13:22", "12:08", "08:22", "18:19", "07:08", "07:52", "02:38", "00:40", "05:19", "22:11", "22:51", "23:19", "02:21", "00:59", "15:42", "22:49", "04:34", "20:38", "05:21", "06:53", "19:33"}

    {3, 17, 8, 12, 2, 21, 8, 2, 20, 11, 3, 15, 15, 22, 23, 6, 2, 18, 10, 2, 12, 12, 13, 19, 16, 10, 19, 8, 19, 12, 1, 11, 21, 6, 9, 21, 5, 20, 14, 6}

    Returns: 200

  36. { "20:25", "17:43", "15:10", "12:10", "17:21", "06:07", "02:24", "12:37", "15:29", "20:01", "21:02", "00:35", "15:34", "07:45", "12:41", "05:18", "04:47", "11:32", "08:13", "10:04", "01:01", "00:11", "08:22", "05:19", "13:09", "23:34", "12:39", "09:24", "09:34", "18:32", "20:42", "18:57", "23:14", "23:35", "13:08", "22:20", "05:00", "22:22"}

    {19, 4, 21, 15, 0, 0, 14, 5, 0, 17, 18, 4, 17, 7, 3, 13, 3, 10, 0, 20, 11, 9, 18, 14, 17, 19, 22, 5, 2, 0, 11, 10, 0, 2, 11, 6, 20, 21}

    Returns: 219

  37. { "14:36", "17:43", "03:04", "14:32", "14:16", "05:24", "09:54", "08:00", "10:49", "21:24", "11:10", "04:06", "17:41", "00:36", "14:50", "19:14", "10:01", "09:31", "13:32", "23:02", "15:04", "20:40", "00:32", "05:37", "11:14", "15:05", "05:34", "13:26", "04:28", "18:52", "18:58", "16:25", "09:04", "15:02", "00:13"}

    {1, 10, 19, 19, 18, 10, 10, 2, 20, 18, 8, 22, 9, 12, 3, 0, 2, 23, 11, 0, 20, 3, 3, 0, 18, 12, 21, 0, 13, 9, 2, 9, 1, 16, 7}

    Returns: 261

  38. { "15:31", "18:55", "01:45", "14:49", "20:18", "04:19", "19:56", "16:18", "13:06", "10:34", "17:19", "05:01", "11:03", "18:23", "00:01", "08:51", "10:36", "18:56", "00:33", "22:34", "05:17", "21:31", "04:25", "20:49", "13:34", "22:22", "22:56", "03:27", "17:06", "10:03", "06:19", "14:03", "05:48", "16:16", "18:50", "17:09", "05:17", "09:27", "20:52"}

    {1, 12, 16, 0, 1, 22, 1, 14, 23, 17, 7, 0, 22, 12, 22, 11, 23, 14, 5, 12, 6, 22, 11, 3, 3, 0, 14, 2, 19, 3, 17, 11, 10, 23, 17, 15, 0, 4, 21}

    Returns: 197

  39. { "13:52", "20:18", "03:21", "03:42", "07:45", "20:45", "23:47", "00:44", "18:21", "03:38", "15:22", "16:16", "22:22", "00:13", "02:27", "09:36", "06:01", "19:26", "05:25", "22:59", "06:22", "07:37", "20:34", "09:01", "19:01", "00:43", "06:44", "17:10", "06:05", "06:25", "05:37", "14:20", "17:54", "00:14", "03:04", "15:51", "15:04", "01:38"}

    {22, 17, 10, 6, 0, 19, 6, 3, 13, 9, 4, 0, 2, 14, 22, 11, 1, 0, 12, 6, 8, 10, 16, 5, 4, 5, 12, 9, 23, 2, 0, 8, 20, 14, 23, 14, 11, 19}

    Returns: 191

  40. { "00:35", "20:39", "14:02", "03:37", "09:25", "09:17", "01:42", "14:13", "18:24", "16:45", "09:29", "21:02", "01:27", "13:53", "18:36", "04:27", "03:00", "05:18", "23:45", "18:02", "11:19", "07:09", "07:38", "07:53", "03:33", "15:08", "01:21", "14:14", "00:35", "22:20", "09:47", "04:16", "02:22", "18:34", "16:31", "14:38", "17:02", "12:23"}

    {7, 13, 15, 16, 1, 21, 4, 14, 3, 21, 23, 11, 22, 2, 15, 10, 19, 20, 20, 3, 0, 0, 17, 14, 5, 23, 20, 20, 0, 10, 3, 10, 4, 8, 17, 11, 8, 6}

    Returns: 199

  41. {"00:00","00:36","01:12","01:48","02:24","03:00","03:36","04:12","04:48","05:24","06:00","06:36","07:12","07:48","08:24","09:00","09:36","10:12","10:48","11:24","12:00","12:36","13:12","13:48","14:24","15:00","15:36","16:12","16:48","17:24","18:00","18:36","19:12","19:48","20:24","21:00","21:36","22:12","22:48","23:24"}

    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}

    Returns: 1404

  42. {"22:43", "19:57", "07:53", "12:46", "13:09", "19:02", "19:50", "22:23", "18:00", "16:52", "08:11", "21:27", "02:02", "19:02", "07:07", "18:29", "18:42", "15:29", "16:13", "10:31", "21:09", "23:21", "01:44", "20:38", "18:35", "22:53", "20:31", "09:56", "02:02", "01:16", "21:45", "15:44", "17:56", "09:46", "17:13", "15:24", "09:42", "15:14", "20:14", "14:03" }

    {7, 0, 12, 2, 20, 0, 3, 11, 2, 7, 12, 12, 20, 0, 19, 4, 10, 18, 6, 11, 3, 10, 2, 10, 11, 9, 17, 14, 21, 12, 4, 20, 13, 8, 14, 1, 9, 17, 4, 11 }

    Returns: 294

  43. {"11:37", "10:20", "15:48", "08:20", "09:50", "10:32", "16:04", "18:58", "23:54", "02:41", "09:57", "04:41", "09:56", "18:30", "20:08", "08:32", "11:49", "15:36", "17:19", "13:10", "02:54", "04:06", "00:27", "22:21", "03:25", "20:02", "17:29", "12:08", "20:17", "16:05", "17:46", "18:20", "05:47", "09:45", "10:22", "12:41", "22:17", "04:44", "14:52", "14:54" }

    {18, 15, 9, 3, 9, 11, 8, 11, 14, 21, 8, 5, 19, 20, 6, 14, 9, 4, 19, 16, 7, 16, 2, 0, 18, 3, 7, 15, 19, 10, 0, 17, 1, 2, 3, 7, 1, 16, 11, 23 }

    Returns: 264

  44. {"00:21", "00:32", "00:36", "00:31", "00:02", "00:25", "00:40", "00:29", "00:30", "00:40", "00:39", "00:58", "00:18", "00:23", "00:09", "00:37", "00:47", "00:23", "00:02", "00:17", "00:21", "00:28", "00:22", "00:30", "00:14", "00:58", "00:17", "00:13", "00:58", "00:49", "00:36", "00:53", "00:21", "00:32", "00:51", "00:18", "00:00", "00:21", "00:12", "00:14" }

    {7, 1, 3, 0, 16, 5, 17, 10, 9, 21, 11, 19, 20, 6, 4, 23, 15, 22, 2, 8, 14, 12, 13, 18, 14, 19, 15, 8, 21, 11, 22, 21, 5, 0, 10, 6, 16, 11, 1, 20 }

    Returns: 1322

  45. {"06:14", "12:03", "04:35", "14:48", "23:58", "15:28", "06:02", "08:34", "10:02", "18:59", "00:45", "15:50", "05:46", "17:49", "11:28", "10:06", "20:26", "11:26", "20:54", "17:53", "20:39", "05:14", "19:23", "10:00", "00:18", "20:53", "06:20", "16:30", "07:13", "22:35", "20:43", "14:25", "11:23", "10:49", "11:44", "16:18", "20:04", "04:02", "18:21", "03:25" }

    {15, 4, 15, 10, 3, 7, 11, 16, 11, 9, 8, 17, 18, 19, 3, 13, 19, 6, 13, 16, 13, 9, 14, 3, 18, 17, 9, 19, 16, 11, 18, 9, 15, 6, 14, 2, 12, 5, 2, 0 }

    Returns: 294

  46. {"02:35", "16:14", "22:45", "00:01", "11:46", "10:11", "20:09", "21:45", "00:32", "05:35", "18:12", "01:29", "04:04", "05:32", "06:22", "20:06", "09:39", "07:02", "23:25", "04:21", "19:58", "09:22", "14:20", "14:57", "07:59", "08:26", "15:04", "03:39", "16:12", "18:10", "03:44", "10:45", "02:20", "09:22", "00:55", "23:04", "04:14", "09:01", "19:47", "07:17" }

    {5, 14, 17, 16, 1, 14, 14, 9, 23, 6, 8, 5, 1, 21, 1, 0, 17, 6, 7, 0, 5, 4, 5, 20, 22, 20, 0, 23, 22, 18, 23, 21, 10, 7, 3, 20, 9, 16, 22, 22 }

    Returns: 226

  47. {"05:56", "04:48", "06:14", "13:02", "16:11", "11:27", "22:49", "04:01", "14:20", "09:33", "07:07", "18:52", "01:08", "21:04", "20:49", "19:52", "22:00", "18:10", "07:10", "02:08", "16:12", "19:34", "14:58", "20:55", "11:17", "12:25", "15:50", "05:23", "05:10", "19:14", "09:07", "08:47", "16:07", "02:33", "12:14", "18:23", "10:43", "14:25", "02:01", "06:48" }

    {4, 14, 3, 20, 17, 19, 2, 17, 21, 0, 3, 22, 2, 9, 8, 22, 8, 2, 13, 5, 12, 13, 12, 23, 7, 22, 21, 23, 1, 17, 21, 8, 1, 2, 20, 15, 22, 18, 11, 13 }

    Returns: 216

  48. {"00:11", "00:12", "00:13", "00:14", "00:15", "00:16", "00:17", "00:18", "00:19", "00:20", "00:21", "00:22", "00:23", "00:24", "00:25", "00:26", "00:27", "00:28", "00:29", "00:30", "00:31", "00:32", "00:33", "00:34", "00:35", "00:36", "00:37", "00:38", "00:39", "00:40", "00:41", "00:42", "00:43", "00:44", "00:45", "00:46", "00:47", "00:48", "00:49", "00:50" }

    {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }

    Returns: 1341


This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2024, TopCoder, Inc. All rights reserved.
This problem was used for: