#include #include using namespace std; int main() { int n; int a = 0; cin >> n; int flower_array[n]; for (int i = 0; i < n; i++) { cin >> flower_array[i]; } for (int i = 0; i < n; i++) { for (int j = 0; j < n - i; j++) { double average = 0; for (int k = 0; k <= j; k++) { average += flower_array[i+k]; } average /= (j+1); for (int k = 0; k <= j; k++) { if (flower_array[i+k] == average) { a++; break; } } } } //a -= n; cout << a; return 0; }