daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest May 17th, 2018 107 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. public static void main(String[] args) {
  2.         task_A();
  3.     }
  4.    
  5.     public static void task_A(){
  6.         Scanner in = new Scanner (System.in);
  7.  
  8.         while(in.hasNext()){
  9.             GraphModel gm = new GraphModel();
  10.             int limit = in.nextInt();
  11.             int limit2 = in.nextInt();
  12.             in.nextLine();
  13.  
  14.             for(int i = 0; i < limit; i++){
  15.                 in.next();
  16.                 String firstOne = String.format("%s %s %s %s", in.next(),in.next(),in.next(),in.next());
  17.                 String secondOne = String.format("%s %s %s %s",in.next(),in.next(),in.next(),in.next());
  18.                 IGpsCoordinate a = new GpsCoordinate(firstOne);
  19.                 IGpsCoordinate b = new GpsCoordinate(secondOne);
  20.  
  21.                 gm.addNode(new Node(a, b));
  22.             }
  23.            
  24.             for(int j=0; j<limit2; j++){
  25.                 int con = in.nextInt();
  26.                 int conTo = in.nextInt();
  27.                
  28.                 gm.addConnection(new Connection (gm.nodes.get(con), gm.nodes.get(conTo)));
  29.             }
  30.            
  31.             gm.setLimits();
  32.  
  33.             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());
  34.         }
  35.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top