Let the number of students in the class be x and number of benches in the class be y.
According to the question,
3y+1=x
x−3y=1 …… (1)
Also,
(y−1)4=x
4y−4=x
x−4y=−4 …… (2)
Solving equations (1) and (2), we get
x=16 and y=5
Hence, the number of students in the class is 16 and the number of benches in the class is 5.