A bill was defeated in the legislature by 50 votes. If one-fifth of those voting against the bill had voted for it, the bill would have passed by 30 votes. How many legislators voted for the bill?

nays = ayes + 50

ayes + 1/5 nays = 4/5 nays + 30

so, substituting in the nays, we have

ayes + 1/5 (ayes+50) = 4/5 (ayes+50) + 30
6/5 ayes + 10 = 4/5 ayes + 70
2/5 ayes = 60
ayes = 150