Code for alg-competition