короче, я сделал так что строго между минимум и максимумом, можешь изменить потом, если нужно включая индексы мин и макса
#include<bits/stdc++.h>
#define ll long long
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define pb push_back
#define in insert
#define popb pop_back
#define ul unsigned long int
#define ld long double
using namespace std;
ll m, n, k, b, a[10000];
vector <ll> p;
string s, t, c;
set <int> st;
int main(){
fast;
cin >> n;
ll ans = 0, cnt = 1, mx = (ll)1e9 + 1, mn = (ll)-1e9 + 123, i = 0, idmn = 0, idmx = 0;
while(n--){
cin >> a[i];
if (a[i] % 2 == 0){
ans += a[i];
ans %= 106;
}
if (mx < a[i]){
mx = a[i];
idmx = i;
else if (mn > a[i]){
mn = a[i];
idmn = i;
i++;
ll idmn1 = min(idmn, idmx);
ll idmx2 = max(idmn, idmx);
for (int i = idmn1; i < idmx2; i++){
cnt *= a[i];
cnt %= 106;
cout << ans % 106 << ' ' << cnt % 106;
return 0;
1)
a = int(input())
b = int(input())
for i in range(a, b+1):
if i % ... == 0 and i % ... != 0:
...
print(...)
2)
x = a*2
n = 0
while a < x:
a = a + (a * 0.1)
n += 1
print(n/4)
3)
sum = 0
for i in range(100):
if a < 0 and a % 2 != 0:
sum += a
print(a)
4)
a = input()
if a.count('0') != 0:
print('est`')
else:
print('net')
5)
p = int(input())
n = int(input())
c = 0
for i in range(n):
if a > p:
c += 1
print(c)
6)
if a % 10 == 5:
7)
x = int(input())
if a <= x <= b:
8)
x = float(input())
if x > 10:
sum += x
print(x / c)
9)
while True:
if a == 0:
break
if a % 2 == 0:
10)
if x < 10:
11)
if x % 10 == 3:
12)
x = input()
if x.count('4') != 0:
print('yes')
print('no')
короче, я сделал так что строго между минимум и максимумом, можешь изменить потом, если нужно включая индексы мин и макса
#include<bits/stdc++.h>
#define ll long long
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define pb push_back
#define in insert
#define popb pop_back
#define ul unsigned long int
#define ld long double
using namespace std;
ll m, n, k, b, a[10000];
vector <ll> p;
string s, t, c;
set <int> st;
int main(){
fast;
cin >> n;
ll ans = 0, cnt = 1, mx = (ll)1e9 + 1, mn = (ll)-1e9 + 123, i = 0, idmn = 0, idmx = 0;
while(n--){
cin >> a[i];
if (a[i] % 2 == 0){
ans += a[i];
ans %= 106;
}
if (mx < a[i]){
mx = a[i];
idmx = i;
}
else if (mn > a[i]){
mn = a[i];
idmn = i;
}
i++;
}
ll idmn1 = min(idmn, idmx);
ll idmx2 = max(idmn, idmx);
for (int i = idmn1; i < idmx2; i++){
cnt *= a[i];
cnt %= 106;
}
cout << ans % 106 << ' ' << cnt % 106;
return 0;
}
1)
a = int(input())
b = int(input())
for i in range(a, b+1):
if i % ... == 0 and i % ... != 0:
...
print(...)
2)
a = int(input())
x = a*2
n = 0
while a < x:
a = a + (a * 0.1)
n += 1
print(n/4)
3)
sum = 0
for i in range(100):
a = int(input())
if a < 0 and a % 2 != 0:
sum += a
print(a)
4)
a = input()
if a.count('0') != 0:
print('est`')
else:
print('net')
5)
p = int(input())
n = int(input())
c = 0
for i in range(n):
a = int(input())
if a > p:
c += 1
print(c)
6)
n = int(input())
c = 0
for i in range(n):
a = int(input())
if a % 10 == 5:
c += 1
print(c)
7)
a = int(input())
b = int(input())
n = int(input())
c = 0
for i in range(n):
x = int(input())
if a <= x <= b:
c += 1
print(c)
8)
n = int(input())
c = 0
sum = 0
for i in range(n):
x = float(input())
if x > 10:
sum += x
c += 1
print(x / c)
9)
c = 0
while True:
a = int(input())
if a == 0:
break
if a % 2 == 0:
c += 1
print(c)
10)
n = int(input())
c = 0
sum = 0
for i in range(n):
x = float(input())
if x < 10:
sum += x
c += 1
print(x / c)
11)
n = int(input())
c = 0
for i in range(n):
x = int(input())
if x % 10 == 3:
c += 1
print(c)
12)
x = input()
if x.count('4') != 0:
print('yes')
else:
print('no')