import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Scanner; public class CrowdedForest { static final int MaxClearing = 500; /* ------------------- INSERT CODE HERE ---------------------*/ public static void findPaths() { } /* -------------------- END OF INSERTION --------------------*/ public static void main(String[] argv) { int c1 = 0, c2 = 0; String animal; Scanner sc = new Scanner(System.in); while (sc.hasNextLine()) { Scanner lsc = new Scanner(sc.nextLine()); // read in trails if (lsc.hasNextInt()) { c1 = lsc.nextInt(); c2 = lsc.nextInt(); // change to handle multiple animals on trail while (lsc.hasNext()) { animal = lsc.next(); // c1, c2, animal has info you need } continue; } } findPaths(); } }