4 minutes to walk there, 5 minutes to walk back, 4+5 = 9 minutes total walking time. Add this onto the 1 minute to get the copier set up and we have 9+1 = 10 minutes so far.
The copier can print 38 pages per minute. There are 836 copies, so 836/38 = 22 minutes is needed to print out all the pages.
So we have 22+10 = 32 minutes in total so far. Add on the last 5 minute stretch (going from the math department to your 2PM class) to get to 37 minutes. You'll need 37 minutes total.
You didn't provide a starting time, but we can subtract 37 minutes from 2PM to get
02:00 - 00:37 = 01:23
Meaning that if you left the math department at 1:37 PM, then you'd do all those tasks to get to your next class at 2 PM exactly, assuming no other things happen. So it's best to leave before 1:37 PM