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){
int n=Integer.parseInt(m);
BigInteger bg=BigInteger.valueOf(n);
BigInteger result=(bg.divide(BigInteger.valueOf(2))).add(BigInteger.valueOf(2));
result=result.multiply(result.subtract(BigInteger.ONE)).divide(BigInteger.valueOf(2));
sb.append(result).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){
int n=Integer.parseInt(m);
BigInteger bg=BigInteger.valueOf(n);
BigInteger result=(bg.divide(BigInteger.valueOf(2))).add(BigInteger.valueOf(2));
result=result.multiply(result.subtract(BigInteger.ONE)).divide(BigInteger.valueOf(2));
sb.append(result).append("\n");
}
System.out.print(sb);
}
}
No comments:
Post a Comment