Jing records the amount of time he spends studying in 1 month. He spends a total of 82 hours studying math, chemistry, and history. The number of hours he spends on chemistry is twice the number that he spends on math. He spends 7 hours more than 4 times the number of hours on history as he does on math and chemistry combined. How much time does he spend studying each subject?