fork download
  1. import java.util.Scanner;
  2. import java.math.BigInteger;
  3. class Cseq
  4. {
  5. public static void main(String []args)
  6. {
  7. Scanner jais=new Scanner(System.in);
  8. int x=100000;
  9. BigInteger []a = new BigInteger[x];
  10. a[0]=BigInteger.ONE;
  11. for(i=BigInteger.ONE;i.compareTo(BigInteger.valueOf(x))<=0;i=i.add(BigInteger.ONE))
  12. {
  13. a[i]=a[(i.subtract(BigInteger.ONE))].multiply(i);
  14. }
  15. int t=jais.nextInt();
  16. while(t--!=0)
  17. {
  18. BigInteger n=jais.nextBigInteger();
  19. BigInteger p=jais.nextBigInteger();
  20. BigInteger q=jais.nextBigInteger();
  21. BigInteger v=(q.subtract(p)).add(BigInteger.ONE);
  22. for(j=BigInteger.ONE;j.compareTo(n)<=0;j=j.add(BigInteger.ONE))
  23. {
  24. sum=sum.add(a[v].divide(a[(v.subtract(j))].multiply(a[j])));
  25. sum=sum.add(v);
  26. }
  27. sum=sum.subtract(v);
  28. System.out.println(sum);
  29. }
  30. jais.close();
  31. }
  32. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:14: error: incompatible types: BigInteger cannot be converted to int
			a[i]=a[(i.subtract(BigInteger.ONE))].multiply(i);
			  ^
Main.java:14: error: incompatible types: BigInteger cannot be converted to int
			a[i]=a[(i.subtract(BigInteger.ONE))].multiply(i);
			                  ^
Main.java:27: error: incompatible types: BigInteger cannot be converted to int
			sum=sum.add(a[v].divide(a[(v.subtract(j))].multiply(a[j])));
			              ^
Main.java:27: error: incompatible types: BigInteger cannot be converted to int
			sum=sum.add(a[v].divide(a[(v.subtract(j))].multiply(a[j])));
			                                                      ^
Main.java:27: error: incompatible types: BigInteger cannot be converted to int
			sum=sum.add(a[v].divide(a[(v.subtract(j))].multiply(a[j])));
			                                     ^
5 errors
stdout
Standard output is empty