Why my code is wrong

all test case are wrong

hello @naaz
pls save ur code here -> https://ide.codingblocks.com/
and share the link with me.

hello @naaz
image

first read n and the initialise r.

also declare ur array like this.
int a[n] // do this after reading n