HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Functions > problem:


50305 - John's Tasks

Guest
• Review clarifications (1)

Volume problems

• 132. 50474 - Sum of Two Primes
• 165. 50577 - Perfect Numbers and ...
• 190. 50533 - Contacts List
• 200. 50454 - What day is it?
• 210. 50369 - Base Conversion
• 250. 50385 - The 3n + 1 problem
• 260. 50493 - n-digit kth Prime Number
• 50307 - Palindromes
• 50305 - John's Tasks
• 002. 50428 - Three Times
• 010. 50582 - Number of digits
• 035. 50467 - Random Numbers
• 062. 50390 - Total Salary Paid
• 100. 50397 - The Number of Points ...
• 135. 50572 - Palindromic Numbers
• 145. 50586 - Prime Palindromes
• 160. 50571 - Armstrong Numbers - 2

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Geri Gokaj.

John's Tasks

John is a married man. His wife is asking him to do N-tasks every N[a] days.

For example: He should wash the car every 3 days. Water the flowers every 2 days etc.

The user will be given the frequency of every tasks.

We accept that he performed all the tasks today. You need to write a program to find out after how many days he will perform all the tasks again in one day.

Input specification
-In the first line, you will enter the number of tasks(N) -In the following line, N integer numbers that represent the frequency of each task.

Output specification
The first day after today where he has to perform all the tasks again.

Sample Input I
4
3 2 4 5
Sample Input II
3
2 1 3
Sample Input III
8
3 5 7 11 13 17 21 20
Sample Output I
60
Sample Output II
6
Sample Output III
1021020


Для отправки решений необходимо выполнить вход.

www.contester.ru