Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- task_A();
- }
- public static void task_A(){
- Scanner in = new Scanner (System.in);
- while(in.hasNext()){
- GraphModel gm = new GraphModel();
- int limit = in.nextInt();
- int limit2 = in.nextInt();
- in.nextLine();
- for(int i = 0; i < limit; i++){
- in.next();
- String firstOne = String.format("%s %s %s %s", in.next(),in.next(),in.next(),in.next());
- String secondOne = String.format("%s %s %s %s",in.next(),in.next(),in.next(),in.next());
- IGpsCoordinate a = new GpsCoordinate(firstOne);
- IGpsCoordinate b = new GpsCoordinate(secondOne);
- gm.addNode(new Node(a, b));
- }
- for(int j=0; j<limit2; j++){
- int con = in.nextInt();
- int conTo = in.nextInt();
- gm.addConnection(new Connection (gm.nodes.get(con), gm.nodes.get(conTo)));
- }
- gm.setLimits();
- System.out.printf("(%s, %s)\n(%s, %s)\n", gm.getTopLeft().getLatitude().toString(), gm.getTopLeft().getLongitude().toString(), gm.getBottomRight().getLatitude().toString(), gm.getBottomRight().getLongitude().toString());
- }
- }
Add Comment
Please, Sign In to add comment