http://codeforces.com/contest/450/problem/A
1 #include<iostream> 2 #include<cstdlib> 3 #include<cstring> 4 using namespace std; 5 int main(){ 6 int n,m,x,k; 7 while(cin>>n>>m){ 8 int max=-1; 9 for(int i=1;i<=n;i++){ 10 cin>>x; 11 if((x-1)/m>=max){ 12 k=i; 13 max=(x-1)/m; 14 } 15 //cout<<k<<" "<<endl; 16 } 17 cout<<k<<endl; 18 } 19 return 0; 20 }