Problem A

Statement
Copy Copied
A. Sublime Sequencetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFarmer John has an integer $$$x$$$. He creates a sequence of length $$$n$$$ by alternating integers $$$x$$$ and $$$-x$$$, starting with $$$x$$$. For example, if $$$n = 5$$$, the sequence looks like: $$$x, -x, x, -x, x$$$.He asks you to find the sum of all integers in the sequence.InputThe first line contains an integer $$$t$$$ ($$$1 \leq t \leq 100$$$)  — the number of test cases.The only line of input for each test case is two integers $$$x$$$ and $$$n$$$ ($$$1 \leq x, n \leq 10$$$).OutputFor each test case, output the sum of all integers in the sequence.ExampleInput41 42 53 64 7Output0
2
0
4

Submissions

IDLanguageExit CodeTimestampCodeStdoutStderrRetry
5532 go 0 2026-03-16T02:28:49.503479Z View View View Retry

Evaluations

Eval IDRun IDProviderModelLangSuccessTimestampPromptResponseStdoutStderrRetry
2608 20260316-000006 openai gpt-5.4 go false 2026-03-16T00:00:28.850455Z View View View View Retry