Skip to content

Instantly share code, notes, and snippets.

@PreSoichiSumi
Created April 26, 2016 07:55
Show Gist options
  • Save PreSoichiSumi/ae0b4906c5f0fd6e55cf597c4d3692b4 to your computer and use it in GitHub Desktop.
Save PreSoichiSumi/ae0b4906c5f0fd6e55cf597c4d3692b4 to your computer and use it in GitHub Desktop.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int a=sc.nextInt();
int b=sc.nextInt();
int ap=(a+1)*b;
int bp=a*(b+1);
int res;
if(ap>bp){
res=ap;
}else{
res=bp;
}
System.out.println(res);
sc.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment