A rope 580 cm long is to be cut into 40 cm and 90 cm segments without any wastage. How many ways are there to do this?

1

2

3

4