In a class of 40 students, 5 students did not borrow any books from the library, 15 students each borrowed 1 book, 10 students each borrowed 2 books, and the rest of the students each borrowed at least 3 books. If the average (arithmetic mean) number of books borrowed per student was 2, what is the maximum number of books that any single student could have borrowed ?  Select the correct option:
A) 3
B) 5
C) 8
D) 13
E) 18
The average number of books per student was 2means that total of   2*40= 
<gadget id="calculator">  2*40</gadget>
<output>80</output>
80 books were borrowed;   5+15+10= 
<gadget id="calculator">5+15+10</gadget>
<output>30</output>
30 students borrowed total of  5*0+15*1+10*2= 
<gadget id="calculator"> 5*0+15*1+10*2</gadget>
<output>35</output>
35 books;   So  80-35= 
<gadget id="calculator"> 80-35</gadget>
<output>45</output>
45 books are left to distribute among 40-30= 
<gadget id="calculator">40-30</gadget>
<output>10</output>
10 students, these 10 arethe rest who borrowed at least 3 books;   Tomaximizethe number of books one student from above 10 could have borrowed we shouldminimizethe number of books other 9 students from 10 could have borrowed. Minimum these 9 students could have borrowed is 3 books per student, so total number of books they could have borrowed is 9*3= 
<gadget id="calculator">9*3</gadget>
<output>27</output>
27 books. So the 10th student could have borrowed is  45-27= 
<gadget id="calculator"> 45-27</gadget>
<output>18</output>
18 books.   Answer: 18.
<result>E</result>
In a class of 40 students, 5 students did not borrow any books from the library, 15 students each borrowed 1 book, 10 students each borrowed 2 books, and the rest of the students each borrowed at least 3 books. If the average (arithmetic mean) number of books borrowed per student was 2, what is the maximum number of books that any single student could have borrowed ?