很简单了,
当m>=3&&m<=n+p时是yes
import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input=new Scanner(System.in); while(input.hasNext()){ BigInteger n=input.nextBigInteger(); BigInteger m=input.nextBigInteger(); BigInteger p=input.nextBigInteger(); if(m.compareTo(BigInteger.valueOf(3))>-1&&m.compareTo(n.add(p))<1){ System.out.println("YES"); } else System.out.println("NO"); } } }