I can figure out the short formula many contestant used and in TT(tutorial). Can anyone give me some explanation on this.. sketch etc. Thanks in Advance.

# | User | Rating |
---|---|---|

1 | tourist | 3619 |

2 | Um_nik | 3493 |

3 | ecnerwala | 3446 |

4 | Radewoosh | 3383 |

5 | ksun48 | 3357 |

6 | yosupo | 3324 |

7 | Benq | 3299 |

8 | maroonrk | 3243 |

9 | apiadu | 3238 |

10 | Petr | 3217 |

# | User | Contrib. |
---|---|---|

1 | Errichto | 207 |

2 | Monogon | 199 |

3 | SecondThread | 195 |

4 | vovuh | 189 |

5 | Um_nik | 186 |

5 | antontrygubO_o | 186 |

7 | pikmike | 185 |

8 | Ashishgup | 182 |

9 | pashka | 169 |

10 | Radewoosh | 167 |

I can figure out the short formula many contestant used and in TT(tutorial). Can anyone give me some explanation on this.. sketch etc. Thanks in Advance.

↑

↓

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Oct/28/2020 08:43:22 (h3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

I have tried it. But not finding clue and I am trying more on it.

Extend the sides of the hexagon to form an equilateral triangle (try to see why it is an equilateral triangle). Then the area of this triangle is

`sqrt(3)/4 * a^2`

where`a = a1 + a2 + a3`

is the length of the side of the big triangle. Notice that the area of the original hexagon equals to the`Area of big triangle - Area of 3 triangles`

==> the`area = sqrt(3)/4 * a^2 - sqrt(3)/4 * a1^2 - sqrt(3)/4 * a3^2 - sqrt(3)/4 * a5^2`

. where`a1, a3, and a5`

are the sides of the 3 triangles we added to the hexagon to form the big triangle.Now to see how many triangles of side = 1 exists we divide the area of the hexagon by the area of an equilateral triangle of side length = 1 (which equals

`sqrt(3)/4`

) ==> the answer =`a^2 - a1^2 - a3^2 - a5^2`

.