| 60 | |
| 61 | |
| 62 | public class Solution { |
| 63 | |
| 64 | public static void main(String[] args) throws IOException { |
| 65 | BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); |
| 66 | |
| 67 | BufferedWriter bufferWriter = new BufferedWriter(new FileWriter(System.getenv("OUTPUT_PATH"))); |
| 68 | |
| 69 | int buildingCountCount = Integer.parseInt(bufferedReader.readLine().trim()); |
| 70 | |
| 71 | List<Integer> buildingCount = IntStream.range(0, buildingCountCount).mapToObj(i -> { |
| 72 | |
| 73 | try { |
| 74 | return bufferedReader.readLine().replaceAll("\\s+$", ""); |
| 75 | } |
| 76 | catch (IOException ex) { |
| 77 | throw new RuntimeException(ex); |
| 78 | } |
| 79 | |
| 80 | }) |
| 81 | .map(String::trim) |
| 82 | .map(Integer::parseInt) |
| 83 | .collect(toList()); |
| 84 | |
| 85 | int routerLocationCount = Integer.parseInt (bufferedReader.readLine() .trim()); |
| 86 | |
| 87 | |
| 88 | List<Integer> routerLocation = IntStream.range(0, routerLocationCount).mapToObj(i -> { |
| 89 | |
| 90 | try { |
| 91 | return bufferedReader.readLine().replaceAll("\\s+$", ""); |
| 92 | } |
| 93 | catch (IOException ex) { |
| 94 | throw new RuntimeException(ex) ; |
| 95 | } |
| 96 | |
| 97 | }) |
| 98 | .map(String::trim) |
| 99 | .map(Integer::parseInt) |
| 100 | .collect(toList()); |
| 101 | |
| 102 | int routerRangeCount = Integer.parseInt (bufferedReader.readLine().trim()); |
| 103 | |
| 104 | List<Integer> routerRange = IntStream.range(0, routerRangeCount).mapToObj (i -> { |
| 105 | |
| 106 | try { |
| 107 | return bufferedReader.readLine().replaceAll("\\s+$", ""); |
| 108 | } |
| 109 | catch (IOException ex) { |
| 110 | throw new RuntimeException(ex); |
| 111 | } |
| 112 | }) |
| 113 | |
| 114 | .map(String::trim) |
| 115 | .map(Integer::parseInt) |
| 116 | .collect(toList()); |
| 117 | |
| 118 | int result = Result.getServedBuildings(buildingCount, routerLocation, routerRange); |
| 119 |
nothing calls this directly
no outgoing calls
no test coverage detected