{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"奶牛爱吃苹果是鲜为人知的事实。FJ在他的田地里有两棵苹果树(编号为1和2)。Bessie不会爬树,所以她必须等着苹果掉下来。然而,她必须在空中接住它们,因为苹果落地时碰伤了(谁也不想吃碰伤了的苹果)。Bessie吃得很快,吃的时间可以忽略不计。 每分钟,两棵苹果树中的一棵会掉落一个苹果。Bessie有过很多练习,只要她站在一棵有苹果落下的树下,就能接住一个苹果。Bessie可以很快地在两棵树之间行走,时间忽略不计。她可以随时站在一棵树下。此外,奶牛没有得到大量的锻炼,所以她不愿意在树间来回地来回行走(因此错过了一些苹果)。 苹果下降T(1 \u003c \u003d T\u003c \u003d 1000)分钟。Bessie愿意来回走至多W(1 \u003c \u003d W\u003c \u003d 30)次。考虑哪棵树每分钟会掉落一个苹果,确定贝西能抓到的最大数量的苹果。贝西从树1开始。"}},{"title":"Input","value":{"format":"HTML","content":""}},{"title":"Output","value":{"format":"HTML","content":""}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e7 2\n2\n1\n1\n2\n2\n1\n1\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e6\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\n \u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\n INPUT DETAILS: \n \u003cbr\u003e \n \u003cbr\u003eSeven apples fall - one from tree 2, then two in a row from tree 1, then two in a row from tree 2, then two in a row from tree 1. Bessie is willing to walk from one tree to the other twice. \n \u003cbr\u003e \n \u003cbr\u003eOUTPUT DETAILS: \n \u003cbr\u003e \n \u003cbr\u003eBessie can catch six apples by staying under tree 1 until the first two have dropped, then moving to tree 2 for the next two, then returning back to tree 1 for the final two.\n \u003c/div\u003e"}}]}