t-- logic in SPOJ