should output be at the end of each test case or each subtask?

I’m not sure if this matters or not, but can the answer be output after a task inside of the case, or should the answers all be given after the whole test case is calculated?

it depends on the condition of your problem
like if you want to calculate sum upto n number for t cases and you also will have to output for every iteration so that you will have to print after every iteration like inside a test case
but if you only just need to find total sum so that for that case you will have to use single output after after your testcase

hope this will help you