FEIN's blog

By FEIN, history, 15 months ago, In English
A puzzle, most confounding, I do say,
With loops and variables in endless play,
A maze of code, that does not seem to end,
And answers that are hard, to comprehend.


But beware, the twists and turns ahead, For this problem is not what it seems to be, And every step you take, may lead astray, From the answer you seek, so carefully.

But do not fret, and do not give in, For with each mistake, you do but win, For every error, a lesson learned, And every trial, a battle earned.
So take a deep breath, and start anew,
And trust in your skills, to see this through,
For in this challenge, you shall find,
The true extent, of your programming mind.
A task is given, quite mathematical,
To find the sum, quite functional.
Of two arrays, a and p, they must be,
Of same length, with prime numbers, you'll see.

The product of these primes, you must find, And make sure they're distinct, of this you must remind. The maximum value, is what you must seek, Of the sum of the primes, their product you must peak.

Input is given, t test cases to solve, And n, the integer, to find the sum involved. With care and skill, you must compute this quest, And the maximum value, will stand out from the rest.

So put on your thinking cap, and start your calculation, Find the sum of primes, with inspiration. And when you're done, you'll find your solution, To this mathematical problem, with a resolution.

Full text and comments »

  • Vote: I like it
  • +7
  • Vote: I do not like it