# Prime Jumps
## Problem Statement
You are playing a game on a row of $n$ cells, indexed from $0$ to $n-1$. Each cell $i$ has an associated integer score, $a_i$. You begin your journey at cell $0$ with an initial total score of $0$. The score of cell $0$ is always $0$, i.e., $a_0 = 0$.
Your objective is to reach cell $n-1$. At each step, from your current cell $i$, you can make one of two types of moves:
1. **Move one step to the right**: Move from cell $i$ to cell $i+1$. This move is only valid if $i+1 < n$.
2. **Jump $p$ steps to the right**: Move from cell $i$ to cell $i+p$, where $p$ is a prime number that ends in the digit $3$. This move is only valid if $i+p < n$. Examples of such prime numbers include $3, 13, 23, 43, 53, ext{etc.}$
Whenever you land on a cell (including cell $0$), its score $a_i$ is added to your total score. Your goal is to find the maximum possible total score you can achieve when you reach cell $n-1$.
## Input Format
- First line: An integer $n$ ($1 \le n \le 10^4$) — the number of cells.
- Second line: $n$ integers $a_0, a_1, \dots, a_{n-1}$ ($-10^4 \le a_i \le 10^4$) — the scores of the cells. It is guaranteed that $a_0 = 0$.
## Output Format
Return a single integer: the maximum possible score achievable upon reaching cell $n-1$.
## Sample Test Cases
### Sample Input 1
```
5
0 -10 -20 -30 50
```
### Sample Output 1
```
40
```
### Sample Input 2
```
4
0 -10 100 -20
```
### Sample Output 2
```
70
```
## Constraints
- $1 \le n \le 10^4$
- $-10^4 \le a_i \le 10^4$
- $a_0 = 0$
- Time limit: 1 second
- Memory limit: 256 MB
## Explanation
### Sample Input 1:
For $n=5$ and cell scores $a = [0, -10, -20, -30, 50]$:
To reach cell $4$:
- Path $0 \xrightarrow{+1} 1 \xrightarrow{+1} 2 \xrightarrow{+1} 3 \xrightarrow{+1} 4$: Score $= a_0 + a_1 + a_2 + a_3 + a_4 = 0 + (-10) + (-20) + (-30) + 50 = -10$.
- Path $0 \xrightarrow{+3} 3 \xrightarrow{+1} 4$: Score $= a_0 + a_3 + a_4 = 0 + (-30) + 50 = 20$. (Jump $p=3$ from cell $0$ to $3$, then move $1$ step to $4$)
- Path $0 \xrightarrow{+1} 1 \xrightarrow{+3} 4$: Score $= a_0 + a_1 + a_4 = 0 + (-10) + 50 = 40$. (Move $1$ step to cell $1$, then jump $p=3$ from cell $1$ to $4$)
The maximum score is $40$.
### Sample Input 2:
For $n=4$ and cell scores $a = [0, -10, 100, -20]$:
To reach cell $3$:
- Path $0 \xrightarrow{+1} 1 \xrightarrow{+1} 2 \xrightarrow{+1} 3$: Score $= a_0 + a_1 + a_2 + a_3 = 0 + (-10) + 100 + (-20) = 70$.
- Path $0 \xrightarrow{+3} 3$: Score $= a_0 + a_3 = 0 + (-20) = -20$. (Jump $p=3$ from cell $0$ to $3$)
The maximum score is $70$.
Loading problem statement...