spoj problem - classical