import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n,m,a,b,ans=0; n = sc.nextInt(); m = sc.nextInt(); a = sc.nextInt(); b = sc.nextInt(); int mid=0; for (int i = 0; i <n-a+1 ; i++) { for (int j = 0; j <m-b+1 ; j++) { ans+=func(i,j,a,b); } } System.out.println(ans); } public static int func(int i,int j,int a,int b){ int max=0; for (int k = i; k <a+i ; k++) { if (max==9)break; for (int l = j; l <b+j ; l++) { max = Math.max(max, (k+1)*(l+1)%10); if (max==9)break; } } return max; } }
点赞 1

相关推荐

点赞 评论 收藏
分享
点赞 评论 收藏
分享
牛客网
牛客企业服务