update for spoj4206,max pair,H_K