close
題目概要:
輸入m、n,找出mxn的矩形裡面可以放多少個3x3的正方形。
解題方向:
(m/3)*(n/3)即是答案。
程式碼:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Java | |
import java.util.Scanner; | |
class uva11044{ | |
public static void main(String args[]){ | |
Scanner sc=new Scanner(System.in); | |
int cases=sc.nextInt(); | |
for(int i=0;i<cases;i++){ | |
int m=sc.nextInt(),n=sc.nextInt(); | |
System.out.println((m/3)*(n/3)); | |
} | |
} | |
} |
文章標籤
全站熱搜