{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"Bacteria of a certain type reproduce at a rate of doubling every day. For example: if there are 10 bacteria on the first day, there will be 20 on the second day, 40 on the third day, 80 on the fourth day, and so on. Now given the date and the number of bacteria on the first day, you are asked to write a program to calculate the number of bacteria on a specific day."}},{"title":"Input","value":{"format":"HTML","content":"The first line contains an integer n, indicating the number of test cases. Following are n lines, each containing 5 integers separated by a space. The first integer represents the month of the first day, the second integer represents the date of the first day, the third integer represents the number of bacteria on the first day, the fourth integer represents the month of the requested day, and the fifth integer represents the date of the requested day. It is known that the first day and the requested day are in the same year and that year is not a leap year. The number of bacteria on the requested day is guaranteed to be within the range of a long integer."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output a line containing an integer, which is the number of bacteria on the requested day."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n1 1 1 1 2\r\n2 28 10 3 2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n40\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}