{"type": "session", "harness": "opencode", "id": "misc-0306", "name": "Competitive Programming"} {"type": "message", "message": {"role": "system", "content": "You are an expert competitive programmer. You solve problems by analyzing requirements, designing algorithms, and writing clean, efficient code. When solving problems, explain your reasoning step by step before providing the final solution."}} {"type": "message", "message": {"role": "user", "content": "\"You must lift the dam. With a lever. I will give it to you.\n\nYou must block the canal. With a rock. I will not give the rock to you.\" \n\nDanik urgently needs rock and lever! Obviously, the easiest way to get these things is to ask Hermit Lizard for them.\n\nHermit Lizard agreed to give Danik the lever. But to get a stone, Danik needs to solve the following task.\n\nYou are given a positive integer n, and an array a of positive integers. The task is to calculate the number of such pairs (i,j) that i