/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
List <Long
> lista
= new ArrayList
<>(); for (long a = 1; a <= 10; a++) {
lista.add(a);
}
int avanco = 3;
int numSoma = 500;
for (int i = avanco - 1; i < lista.size(); i += avanco) {
lista.set(i, lista.get(i) + numSoma);
}
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwuQXJyYXlMaXN0OwppbXBvcnQgamF2YS51dGlsLkxpc3Q7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewogICAgICAgIExpc3QgPExvbmc+IGxpc3RhID0gbmV3IEFycmF5TGlzdDw+KCk7CiAgICAgICAgZm9yIChsb25nIGEgPSAxOyBhIDw9IDEwOyBhKyspIHsKICAgICAgICAgICAgbGlzdGEuYWRkKGEpOwogICAgICAgIH0KCiAgICAgICAgaW50IGF2YW5jbyA9IDM7CiAgICAgICAgaW50IG51bVNvbWEgPSA1MDA7CiAgICAgICAgZm9yIChpbnQgaSA9IGF2YW5jbyAtIDE7IGkgPCBsaXN0YS5zaXplKCk7IGkgKz0gYXZhbmNvKSB7CiAgICAgICAgICAgIGxpc3RhLnNldChpLCBsaXN0YS5nZXQoaSkgKyBudW1Tb21hKTsKICAgICAgICB9CgogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbihsaXN0YSk7CgoJfQp9
[1, 2, 503, 4, 5, 506, 7, 8, 509, 10]