Chip It!Problem code: TGPA04 |
All submissions for this problem are available.
The students of IIST are developing their own satellite. So the OBC (OnBoard Computer) team being the most competent of all has been able to design a new 8-bit microprocessor which they plan to name EGSYS-1. Although being very proficient at their work, they are after all students. Thus there are many errors (failures) which occur in the microprocessor based upon various distinct factors. The testing team simulated the failures and found to their surprise that each of the failures occur at definite intervals which don't share any common factor other than 1. They have found the time at which each of the failures occurred last. They also say that when all the failures occur simultaneously the EGSYS-1 will burn off. They want you to predict that time.
Input Format
The first line contains the number of test cases, t.
Each of the following t test case has the following format:
1. The first line contains an integer n indicating the number of distinct failures that occur in EGSYS-1.
2. The second line contains n integers (v1 v2 v3 vn) indicating the intervals (in ns) at which each of the failures occur.
3. The third line contains n (A1 A2 A3 An) integers separated by spaces indicating the last time in nano secs that each error occurred.
Output Format
For each test case, the time (in ns) at which the processor fails.
Sample Input: 1 3 3 4 5 5 7 11 Sample Output: 368
| Author: | theta |
| Date Added: | 26-02-2010 |
| Time Limit: | 2 sec |
| Source Limit: | 50000 Bytes |
| Languages: | C, CLOJ, CPP 4.3.2, F#, GO, PERL6, PYTH 3.1.2, TEXT |
Comments
SUCCESSFUL SUBMISSIONS FOR THIS PROBLEM:
HELP
Program should read from standard input and write to standard output. After you submit a solution you can see your results by clicking on the [My Submissions] tab on the problem page. Below are the possible results:
- Accepted
Your program ran successfully and gave a correct answer. If there is a score for the problem, this will be displayed in parenthesis next to the checkmark. - Time Limit Exceeded
Your program was compiled successfully, but it didn't stop before time limit. Try optimizing your approach. - Wrong Answer
Your program compiled and ran succesfully but the output did not match the expected output. - Runtime Error
Your code compiled and ran but encountered an error. The most common reasons are using too much memory or dividing by zero. For the specific error codes see the help section. - Compilation Error
Your code was unable to compile. When you see this icon, click on it for more information.
If you are still having problems, see a sample solution here.

Fetching successful submissions

how is this answer
how is this answer possible?
If an error occured last at 7ns and occurs at an interval of 4ns, then how can it occur at 368 ns also
similarly for the third error, if it occured at 11ns and occurs at an interval of 5ns, then how can it occur at 368ns???
they defy simple mathematics
its 371 not 368!!
its 371 not 368!!