Question: Don't use chatgpt, write program in java, python or in c + + Folded Area Problem Description Konan is an origamist. Origami is the art
Don't use chatgpt, write program in java, python or in c
Folded Area
Problem Description
Konan is an origamist. Origami is the art of folding paper, and an origamist is a person who practices origami. She is currently working on an origami charactermaking tutorial, where she needs to draw figures to represent each folding step.
The sheet will be in square shaped and will be placed on origin towards the first quadrant. Initially, she will draw a line on the origami sheet. This is called as "folding line" through which the paper is going to get folded. Imagine walking along the folding line from starting point to ending point. Split the regions into left and right side regions.The left side region of the folding line will always be folded onto the right side region. The folding line will always separate the sheet into two regions.
The sheet will have four corners initially. A corner is basically a point where two adjacent sides of the given figure meet. After folding the paper along the folding line, one will get a new polygon. Given the area of the sheet and the cordinates of the folding line, your task is to print all the coordinates of the corners of the folded sheet,resulting polygon
Constraints
Area of the sheet
The starting and ending point of the folding line will always be on the edges corners of the square
Input
The first line contains the area of the sheet.
Second line consists of four space separated integers representing the folding line. First two values representing x y of starting point, second two values representing x y of ending point.
Output
It contains M lines, where M is the number of corners of the polygon resulting after folding
Each line contains two space separated values representing the x y of the current corner point
Restrict the output of points up to two decimal places.
Print the xy coordinates of polygon points obtained after folding in sorted order of x coordinate,followed by sorted order of y coordinate
Time Limit secs
Examples
Example
Input
Output
Explanation
The area will be four so the sheet will have sides of units and it will be represented as And the folding line be
After folding,
since the folded regionleft side lies completely inside the right side, the edges of the new polygon are
Hence the output is
Example
Input
Output
Explanation:
The picture explains why the output is as depicated above.
Folded Area
Problem Description
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
