spoj0; solve "D-Recurrence" from Contest 17