Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Piper's Sugar and Spice

By PiasRoY · Limits 1s, 512 MB

Brawl Stars is a small planet in the Supercell galaxy. Many brawlers live in that planet. Their only responsibility is to brawl with each other. But with all the brawl happening around Colt, the shooter boy fell in love with Piper, the cutest brawler in the planet. But you know, where there is love there will always be some villain brawlers as well. Barbarian King Bull, Evil Gene, Wizard Barley and Shadow Knight Jessie can’t tolerate their sweet affair. So they wanted to create a brawl.

Colt wants to win his love brawling with the villains. So he is standing at the origin (0,0)(0,0) of the brawl coordinate system with Piper. They are surrounded by the villains. As both of them are long range shooters, so villain brawlers are trying to maintain the highest distance from them. To be specific Bull, Gene, Barley and Jessie are standing at different corners of a square. The length of sides of the square is NN and sides are parallel to brawl coordinate system. Colt and Piper are standing at the intersection of diagonals of the square. Orientation of their position with N=10N = 10 is as the picture below. Their orientation doesn’t change, only size of the square changes.

Now Colt only knows the length of the sides of the square. Can you help him know the exact coordinate of the villain brawlers so that he can aim his bullets sharply?


Input contains a single integer N(1N109)N (1\le N\le10^9), the length of the sides of the square. NN will be even.


Print four lines, the coordinates of Bull, Gene, Jessie and Barley respectively.


5 5
5 -5
-5 5
-5 -5



    97% Solution Ratio

    sunkuet02Earliest, Jul '20

    sunkuet02Fastest, 0.0s

    dip_BRURLightest, 0 B

    bokaifShortest, 55B


    Login to submit

    Toph uses cookies. By continuing you agree to our Cookie Policy.