{"problem":{"name":"Contest Result","description":{"content":"There was a contest with $N$ problems. The $i$\\-th $(1\\leq i\\leq N)$ problem was worth $A_i$ points. Snuke took part in this contest and solved $M$ problems: the $B_1$\\-th, $B_2$\\-th, $\\ldots$, and $B","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc290_a"},"statements":[{"statement_type":"Markdown","content":"There was a contest with $N$ problems. The $i$\\-th $(1\\leq i\\leq N)$ problem was worth $A_i$ points.\nSnuke took part in this contest and solved $M$ problems: the $B_1$\\-th, $B_2$\\-th, $\\ldots$, and $B_M$\\-th ones. Find his total score.\nHere, the total score is defined as the sum of the points for the problems he solved.\n\n## Constraints\n\n*   $1\\leq M \\leq N \\leq 100$\n*   $1\\leq A_i \\leq 100$\n*   $1\\leq B_1 < B_2 < \\ldots < B_M \\leq N$\n*   All values in the input are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$ $M$\n$A_1$ $A_2$ $\\dots$ $A_N$\n$B_1$ $B_2$ $\\dots$ $B_M$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc290_a","tags":[],"sample_group":[["3 2\n10 20 30\n1 3","40\n\nSnuke solved the $1$\\-st and $3$\\-rd problems, which are worth $10$ and $30$ points, respectively. Thus, the total score is $10+30=40$ points."],["4 1\n1 1 1 100\n4","100"],["8 4\n22 75 26 45 72 81 47 29\n4 6 7 8","202"]],"created_at":"2026-03-03 11:01:14"}}