|
||||||||||
Choose Your Own AdventureTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 412 Accepted Submission(s): 83 Problem Description After reading the book Tim and Marc Kill Kenny about fifty zillion times, James decided he'd had it with choose-your-own-adventure stories. No matter what choices he made, it seemed like Kenny always fell down an abandoned mine shaft, got run over by a bus load of nuns, or was messily devoured by stray cats. James eventually found the page with the happy ending (where Kenny saves himself by trapping Tim and Marc between the pizza and the hungry programmers) by flipping through the book, but he can't figure out how to get there by following the rules. Luckily, he owns a C compiler... Input Input to this problem will consist of a (non-empty) series of up to 100 data sets, each representing a choose-your-own-adventure story. Each data set will be formatted according to the following description, and there will be no blank lines separating data sets. The first line contains a single integer n indicating the number of data sets. A single data set has 2 components: 1. Page Count - A line containing a single integer X, where 1 < X < 100, indicating the number of pages in the story. 2. Page List - A sequence of X lines, each of which represents a page from the book. Each line has the following components separated from one another by single spaces:
Output For each story in the input:
Sample Input
Sample Output
| ||||||||||
|