{"problem":{"name":"Minimum Sum","description":{"content":"One day, Snuke was given a permutation of length $N$, $a_1, a_2, ..., a_N$, from his friend. Find the following: ![image](https://atcoder.jp/img/agc005/520049e1a049bb9810b398b35d7dcb7f.png)","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc005_b"},"statements":[{"statement_type":"Markdown","content":"One day, Snuke was given a permutation of length $N$, $a_1, a_2, ..., a_N$, from his friend.\nFind the following:\n![image](https://atcoder.jp/img/agc005/520049e1a049bb9810b398b35d7dcb7f.png)\n\n## Constraints\n\n*   $1 ≦ N ≦ 200,000$\n*   $(a_1, a_2, ..., a_N)$ is a permutation of $(1, 2, ..., N)$.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$a_1$ $a_2$ $...$ $a_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc005_b","tags":[],"sample_group":[["3\n2 1 3","9"],["4\n1 3 2 4","19"],["8\n5 4 8 1 2 6 7 3","85"]],"created_at":"2026-03-03 11:01:14"}}