fork download
  1. #include<stdio.h>
  2. #include<string.h>
  3. #include<math.h>
  4. #include<stdlib.h>
  5.  
  6. int main() {
  7. int T,N,v_in,route;
  8. scanf("%d",&T);
  9. while(T--)
  10. {
  11. scanf("%d",&N);
  12. N -= 1;
  13. route =1;
  14. while(N--)
  15. {
  16. scanf("%d",&v_in);
  17. route = (route*v_in)%1234567;
  18. }
  19. printf("%d\n",route);
  20. }
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 2012KB
stdin
2
3
1 3
4
2 2 2
stdout
3
8