Eight pupils were given r exercise books each. If they were given a total of 40 exercise books, form an equation.