initialize upgrade = 1;
while (task is time sensitive and upgrade = 1)
 let previous user of current be current user;
 unit time cost of current user = unit time cost × (1 + %);
 unit time cost of previous user = unit time cost × (1 −  %);
 if (both cost of current user and previous user do not decrease)
  upgrade = 1;
 else
  upgrade = 0;
  rescore current user bo be current user;
Pseudocode 2