From fa0a2c8f3392ca90ee4d2a2599000793607d0c7e Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Sat, 30 Oct 2021 22:39:29 +0800 Subject: [PATCH] A - Era https://codeforces.com/contest/1604/submission/133618725 --- CodeForces/1604/A/A.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 CodeForces/1604/A/A.cpp diff --git a/CodeForces/1604/A/A.cpp b/CodeForces/1604/A/A.cpp new file mode 100644 index 00000000..4e98ea87 --- /dev/null +++ b/CodeForces/1604/A/A.cpp @@ -0,0 +1,19 @@ +#include + +using namespace std; + +int t, n, a, ans; + +int main() { + cin >> t; + while (t--) { + ans = 0; + cin >> n; + for (int i = 1; i <= n; i++) { + cin >> a; + ans = max(ans, a - i); + } + cout << ans << endl; + } + return 0; +}