Условие:

901001;
400001;
39099 + 1;
699999 + 1.

901001 = 90099;
400001 = 39999;
39099 + 1 = 39100;
699999 + 1 = 700000.