Masala #0165
Polindrom to’rtlik
Sizga ingliz alifbosining kichik harflaridan iborat \(S ( 1 \le |S| \le 10^6)\) satr berilgan, siz quyidagi shartni qanoatlantiruvchi \((A, B, C, D)\) to’rtliklar sonini toping:
- \(0 \le A < B < C < D < |S|\)
- \(S_A = S_D\)
- \(S_B = S_C\)
Kiruvchi ma'lumotlar:
INPUT.TXT kirish faylining yagona satrida \(S\) kiritiladi
Chiquvchi ma'lumotlar:
OUTPUT.TXT chiqish faylida shartlarni qanoatlantiradigan \((A,B,C,D)\) to’rtliklar sonini \(10^9+7\) ga bo’lgandagi qoldiqni chop eting.
Misollar
# | input.txt | output.txt |
---|---|---|
1 |
aaaaaac |
15 |
2 |
obbo |
1 |