/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: main.cpp * Author: cteam025 * * Created on October 28, 2017, 9:12 AM */ #include #include #include #define MAX(a,b) ((a)>(b)?(a):(b)) using namespace std; /* * */ int main(int argc, char** argv) { ios::sync_with_stdio(false); while(cin.good()){ int numCnt; cin >> numCnt; if (!cin.good()) return 0; int actDiff, seqCnt, seqCntMax; int prevNum; actDiff = seqCntMax = 0; seqCnt = 1; cin >> prevNum; int lastStart = 0; for(int i=1; i> num; if (num-prevNum != actDiff){ seqCntMax = MAX(seqCntMax, seqCnt); seqCnt = 1; actDiff = num-prevNum; lastStart = i-1; }else{ ++seqCnt; } prevNum = num; } cout << lastStart+1 << endl; } return 0; }