SERI07 - Strange But Easy
Hari is very bright student and always solves mathematical problems and series. Lalit (who jealous of him) gives him a series to find the logic and find as many terms as Lalit wants. Hari not getting the logic and wants you to help him.
Your task is so simple, you have to find the terms of the series. Few terms of the series are 11 90 346 936 ...
It isn't too irritating to do that...?
Yeah it is, so look at the hint and do it.
Hint: This is actually not the hint... it's the answer... The series is formed by Prime Number Combinations. For example: 1st term (2 * 3) + 5 = 11, 2nd term (7 * 11) + 13 = 90 so on. It's too easy now for you. Just Basic to check your programming skill :P
Input
First line of input is 't' - number of test cases. In each of the next t lines there is only one Integer n (n < 10000).
Output
Output is the n term of the series.
Warning: be careful with large output data.
Example
Input: 3 1 2 3 Output: 11 11 90 11 90 346
hide comments
rithish832:
2021-05-14 19:39:07
TLE in java even used fast IO
|
|
alifsaddid16_:
2018-10-16 07:00:21
AC in one go, just generate prime using Sieve of Erathostenes |
|
ndrewxie:
2018-06-01 15:50:50
Easy - AC in one go. Hardest part was finding the nth prime |
|
shivam_mnnit:
2017-05-09 21:43:50
AC in first go... :)
|
|
nagendra_4:
2017-02-24 15:06:59
little logic
|
|
erthax_070:
2016-10-14 20:31:04
problem lies only in writing your thoughts down :)
|
|
ravikc12:
2016-10-03 20:26:41
easy but took me an hour to figure out |
|
queen_123:
2016-01-29 12:03:36
use primes concept...... |
|
[Rampage] Blue.Mary:
2016-01-29 09:16:37
This problem should be moved into riddle section. |
Added by: | Losser |
Date: | 2016-01-27 |
Time limit: | 0.100s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 GOSU |
Resource: | own |