```
int m;
cin >> m;
int d[m],g[m];
for (int i=1;i<=m;i++){
cin >> g[i] >> d[i];
}

```

I set m to be 3. Then I set g[i] and d[i] to be 2 and 9 , 5 and 25 , 16 and 24 (first number is g[i] and second is d[i]). And later in the program d[1] isn't 9 , it's 24. Any ideas what is happening?