Login
A   A   A  
welcome

 Album 

米Teen唔鐘意玩現成品,喜歡由零件開始砌。99次失敗唔係問題,最緊要係有1次成功!

米Teen總部設在聖公會白約翰會督中學506室,在午膳後和放學後集會。有興趣參與的同學,請與會長或導師聯絡。

米Teen專頁

街景
2025-10-10 18:48:23
溫度31℃ 濕度82% 氣壓1011.09hPa
2025-10-10 08:22:10
閃電31km (0)
2025-10-05 15:05:32
閃電31km (0)
2025-10-05 14:26:16
閃電20km (0)
2025-10-05 14:26:15
閃電20km (0)
2025-10-05 14:15:43
閃電20km (0)
2025-10-05 11:07:55
閃電17km (1)
2025-10-05 09:00:45
閃電12km (1)
2025-10-05 08:57:24
閃電10km (1)
2025-10-05 08:49:54
閃電10km (1)
2025-10-05 08:47:32
閃電10km (2)

Max IDs on a photo paper.

icon

Home>ICT>Python by ...>Max IDs on...

Find the maximum number of ID photos with specified size on a photo paper with specified size.

1# Author: HUANG KWUN HOI (SKHBBSS, class 4D)
2# Last modified: 2020.9.4
3print('Enter the height of ID photo(pixel)')
4id_photo_height = int(input())
5print('Enter the width of ID photo(pixel)')
6id_photo_width = int(input())
7print('Enter the height of photo paper(pixel)')
8photo_paper_height = int(input())
9print('Enter the width of photo paper(pixel)')
10photo_paper_width = int(input())
11place_horizontally_1 = photo_paper_height // id_photo_width
12place_vertically_1 = photo_paper_width // id_photo_height
13method_one = place_horizontally_1 * place_vertically_1
14place_horizontally_2 = photo_paper_height // id_photo_height
15place_vertically_2 = photo_paper_width // id_photo_width
16method_two = place_horizontally_2 * place_vertically_2
17if method_one >= method_two:
18 print(str(place_horizontally_1) + ' x ' +str(place_vertically_1))
19 print('=' + str(method_one))
20else:
21 print(str(place_horizontally_2) + ' x ' +str(place_vertically_2))
22 print('=' + str(method_two))

Download source code

welcome

 Album 

米Teen唔鐘意玩現成品,喜歡由零件開始砌。99次失敗唔係問題,最緊要係有1次成功!

米Teen總部設在聖公會白約翰會督中學506室,在午膳後和放學後集會。有興趣參與的同學,請與會長或導師聯絡。

米Teen專頁

街景
2025-10-10 18:48:23
溫度31℃ 濕度82% 氣壓1011.09hPa
2025-10-10 08:22:10
閃電31km (0)
2025-10-05 15:05:32
閃電31km (0)
2025-10-05 14:26:16
閃電20km (0)
2025-10-05 14:26:15
閃電20km (0)
2025-10-05 14:15:43
閃電20km (0)
2025-10-05 11:07:55
閃電17km (1)
2025-10-05 09:00:45
閃電12km (1)
2025-10-05 08:57:24
閃電10km (1)
2025-10-05 08:49:54
閃電10km (1)
2025-10-05 08:47:32
閃電10km (2)
 ⇧