How Many Triangles
CodeChefOpen on judge ↗
You are given N poles of length 1, 2, 3, ... , N. You need to tell us the number of triangles that can be formed using any three of the given poles. Constraints: 3 Input The first line of the input contains the number of test cases T, at most 10000. Each of the next T lines contains a positive number N. Output For each value of N in the input, output on a new line the number of triangles that c
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start