No.1977 Extracting at Constant Intervals
問題文最終更新日: 2022-06-10 12:46:49
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
yukicoder contest 347
(順位表)
の他の問題:
Problem Statement
You are given an integer sequence $A_1,A_2,\dots,A_N$ consisting of $N$ elements, and integers $M,L$.
Let $B$ be the sequence of length $NM$ formed by concatenating $M$ copies of the integer sequence $A$.
Consider choosing $i$ satisfying $1 \leq i \leq L$. Then, $C_i$ is defined as follows.
Find the maximum value of $C_i$.
Constraints
- $\displaystyle 1 \leq N \leq 10^5$
- $\displaystyle 1 \leq M \leq 10^9$
- $\displaystyle 1 \leq L \leq NM$
- $\displaystyle -10^4 \leq A_i \leq 10^4 \ (1 \leq i \leq N)$
- All input values are integers
Input
$N\ \ M\ \ L$ $A_1\ \ A_2\ \ \dots\ \ A_N$
Output
Output the value you found, followed by a newline.
Sample
Sample 1
Input
5 2 3 4 -6 3 5 -1
Output
12
The sequence $B$ is $B={4,-6,3,5,-1,4,-6,3,5,-1}$.
We have $C_1=2,C_2=-4,C_3=12$, and the maximum value is $12$.
Sample 2
Input
2 3 4 -1 -2
Output
-1
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
magsta