Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) throws FileNotFoundException {
- Scanner sc = new Scanner(new File("level2_1.in"));
- int tuples = sc.nextInt();
- for(int i=0;i<tuples;i++){
- Point p1 = new Point(sc.nextInt() + 0.5, sc.nextInt() + 0.5);
- Point p2 = new Point(sc.nextInt() + 0.5, sc.nextInt() + 0.5);
- double ratio = Double.parseDouble(sc.next());
- Point p12 = new Point(p2.getRow() - p1.getRow(), p2.getCol() - p1.getCol());
- double betrag = p12.getBetrag();
- double betratio = betrag*ratio;
- Point p13 = new Point(p12.getRow()*(betratio/betrag), p12.getCol()*(betratio/betrag));
- Point p14 = new Point(p13.getRow()+p1.getRow(), p1.getCol()+p13.getCol());
- System.out.println(betratio + "");
- System.out.println(p14);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement