Menu

[Solved]1 Start Top Move Downwards Adjacent Number 2 Allowed Walk Downwards Diagonally 3 Walk Non Q37262865

1. You will start from the top and move downwards to an adjacentnumber as in below.

2. You are only allowed to walk downwards and diagonally.

3. You can only walk over NON PRIME NUMBERS.

4. You have to reach at the end of the pyramid as much aspossible.

According to above rules the maximum sum of the numbers from topto bottom in below example is 24.

*1

*8 4

2 *6 9

8 5 *9 3

As you can see this has several paths that fits the rule of NOTPRIME NUMBERS; 1>8>6>9, 1>4>6>9, 1>4>9>91 + 8 + 6 + 9 = 24. As you see 1, 8, 6, 9 are all NOT PRIME NUMBERSand walking over these yields the maximum sum.

And the most important part is to reach the end of the pyramidas much as possible so if I have this pyramid

1

4 8

2 2 2

4 8 6 1

I want the maximum sum to be 9.

Language: C

Expert Answer


Answer to 1. You will start from the top and move downwards to an adjacent number as in below. 2. You are only allowed to walk dow… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *