affiche juste le code, pas d'explications !
- User
System: affiche juste le code, pas d'explications ! User: Tu es un développeur python3 expérimenté, et tu dois concevoir un programme en python (avec des commentaires en français, sans utiliser de librairies externes, sans
if __name__=="__main__":, avec type hints, et en privilégiant les algorythmes a complexité constante (O(1)) et/ou complexité linéaire (O(n))). Le programme va recevoir les données en entrée sur la stdin, et doit répondre sur la stdout. Fabrique moi un programme python qui résout le problème (énoncé en markdown) suivant :We said 3 parts
After the very successful operation to dismantle the Chrono-Alliance, your brigade deserves a celebration!
For your Brigade Bravery and Service Award, your chef has prepared a beautiful cake and it's your turn to serve it.
As tradition dictates, the first cut should be made vertically and cut the cake into three equal pieces. This cut is easy to accomplish on a simple shape, but the chef has taken some creative liberties with the shape of the cake, and you are left with a shapeless mass covered with icing...
In order not to disappoint your team and to impress the chef with your outstanding cutting skills (after all, you were the one who was designated), you want to write a program that calculates the precise location of the two cuts, based on the shape of the cake.
[image: https://iili.io/H0EK30u.md.png] open
You notice that the outline of the cake can be modeled as two broken lines (top edge and bottom edge) whose abscissae are strictly monotonic. The top edge has only positive ordinates, and the bottom edge has only negative ordinates. The two extreme points on the left and right are therefore on the horizontal axis.
Where do you need to make the cuts to divide the cake into three pieces of equal area?
Data
Input
Line 1: An integer A: the number of points on the top edge.
The A following lines: Two integers X and Y representing the coordinates of a point on the top edge of the cake.
Line 1 : An integer B : the number of points on the lower edge.
The B following lines: Two integers X and Y representing the coordinates of a point on the bottom edge of the cake.
The coordinates of the two edges are given from left to right (increasing X coordinate), and their two ends will be identical.
- Assistantpython