AC代码:
#include <stdio.h>
int main(){
int n,m,i,a,max,k,c;
while(~scanf("%d%d",&n,&m)){
k=0;
for(i=0;i<n;i++){
scanf("%d",&c);
if(c%m)
a=c/m+1;
else
a=c/m;
if(i==0){
max=a;
k=i+1;
}
else{
if(max<=a)
{
max=a;
k=i+1;
}
}
}
printf("%d\n",k);
}
return 0;
}