50%x+30%x=8
0.5x+0.3x=8
0.8x=8
x=10
X-20%x=40
x-0.2x=40
0.8x=40
x=50
17-150%x=6.5
17-1.5x=6.5
1.5x=17-6.5
1.5x=10.5
x=7