Every S-leg have 1 head. Find the quantity of legs N in K-head dragon, if they have A head and B legs together.
4 numbers: S, K, A, B. Every numbers is <= 1000.
The quantity of legs of dragon. If input data is contradiction, then output in file –1, if you have some ways of solution – find free from it.
4 7 35 36