Contains solutions to spoj problem in c++