import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) throws IOException {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
StringBuffer sb = new StringBuffer("");
String m="";
while((m=br.readLine())!=null){
BigInteger p=new BigInteger(m);
p=p.abs();
if(p.compareTo(BigInteger.ZERO)==0)
sb.append("1\n");
else if(p.compareTo(BigInteger.ONE)==0)
sb.append("2\n");
else
sb.append((p.multiply(p)).subtract(p.subtract(BigInteger.valueOf(2)))).append("\n");
}
System.out.print(sb);
}
}
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
public class Main {
public static void main(String[] args) throws IOException {
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
StringBuffer sb = new StringBuffer("");
String m="";
while((m=br.readLine())!=null){
BigInteger p=new BigInteger(m);
p=p.abs();
if(p.compareTo(BigInteger.ZERO)==0)
sb.append("1\n");
else if(p.compareTo(BigInteger.ONE)==0)
sb.append("2\n");
else
sb.append((p.multiply(p)).subtract(p.subtract(BigInteger.valueOf(2)))).append("\n");
}
System.out.print(sb);
}
}
No comments:
Post a Comment