Hola Codeforces!
The 2024 Argentinian Programming Tournament (TAP) was held last weekend. This is a 2024-2025 ICPC subregional contest for teams from Argentina to qualify to the South America/South Regional contest. You can send your solutions or do a virtual participation in the Codeforces gym. I invite you all to solve the problems.
The problems were written and prepared by elsantodel90, fredy10, Guty, lsantire, MarcosK, pablobce, reedef and me (MateoCV)
I would like to thank CodigoL, FedeNQ, Aristides, Marckess, MrNachoX and visho33 for solving and reviewing the problems and providing valuable feedback.
Feel free to use this blog to discuss about the problems :)
Happy coding!








These were the authors of each problem:
Thanks to the authors for producing such a great GYM!!
Hint J,K?
For J
If you sort the numbers, what are the different possibilities for adjacent numbers to add up to X?
What's the max number of $$$x / 2$$$ you can have in the list?
There is more to it than these hints, but IMO the problem is mostly annoying to implement rather than difficult to get to the answer.
I did this but it still gives me wrong on test 7?!
What about numbers that are contiguous and add up to X, just think about all the edge cases.
Isn't it simply a question of calculating x combinations and seeing if there are enough elements (x-1) to intercede between them?
I didn't get what you meant.
hint B?
First of all, it is clear that the usefull segments can be like $$$(1, d)$$$ where $$$d$$$ is a divisor of the number $$$K$$$. Think in cases with a lot of divisors like $$$K = 12$$$, can $$$(1, 2)$$$ or $$$(1, 3)$$$ be minimal or there is another segment that makes them unncesary?
where can I find the editorial?
Hit C? Plaese
Check if the intersection point of the line between the sun and the ape and the z=0 plane lies inside the polygon base of the pyramid.
What if the base is like a peanut (2 circles connected via a curved path, don't know a better way to explain the image I'm thinking about). In that case you could have the projection of the apex inside the base but you would wrongly say that there is no shadow region, there is one between the circles.
What happens if a face doesn't get the sun light? What's the condition for that (or the opposite) to happen?
Another hint?
Sure
If a face is shadowed then it casts a shadow.
To check if a face is shadowed you can check if the sun is "behind" the plane that the face lies in.
Just use the normal of the face defined by the points it contains and see the condition it must satisfy with a vector from the apex to the sun.
Can someone give me a hint for E please?
hint for I pls ><
There is a classical problem to pass through every edge of a graph.
Someone help me in problem E? I don't understand how sort the weapons.
You can think of the operation in a different way: going from $$$x$$$ to $$$Ax + B$$$
Comparing to operations $$$(A_1, B_1)$$$ and $$$(A_2, B_2)$$$ the first one will be better if it yields a smaller number. Write down the condition for this.
With the order fixed you can do a DP starting from $$$x = 0$$$. Any $$$x \leq P$$$ gives a feasible solution.
How can you treat the order as fixed? Doesn’t it change for different values of x? I can't see how to either not use two states (one for x and for the weapon) or bit mask or passing through all weapons