i got AC in 2 subcases of TASK-1,i think this is due to precission loss,anything wrong with my approach?
my code->
class eulernumber
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
BigInteger n=new BigInteger("0");
n=sc.nextBigInteger();
long ii=2;
BigDecimal e=new BigDecimal("2.718281");
BigDecimal i=new BigDecimal(n);
BigInteger l=BigInteger.ZERO;
BigDecimal ll=e.add(i.subtract(BigDecimal.ONE).multiply(e));//find nth term of AP
l=e.add(ll).toBigInteger(); fing sum of nth and first term
BigDecimal bb=new BigDecimal(l);
System.out.println(i.divide(BigDecimal.valueOf(ii)).multiply(bb).toBigInteger()); //find sum of nth term of AP
}
}