시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 488 136 131 33.249%

문제

오늘은 상근이의 생일이다. 상근이는 친구들과 피자를 먹으러 갔다.

상근이의 친구들은 매우 어려서 피자 한 판을 먹을 수 없다. 하지만, 각 친구들은 자신이 먹을 수 있는 피자의 양을 알고 있다.

친구들이 먹을 수 있는 피자의 양은 항상 1/4, 1/2, 3/4 중 하나이다.

상근이는 피자 최소 몇 판을 시키면 친구들이 모두 피자를 자신이 먹을 수 있는 양만큼 먹을 수 있는지 구하는 프로그램을 작성하시오. 상근이는 피자를 먹지 않으며, 모든 친구들이 정확히 한 조각씩 피자를 가져야 한다.

입력

첫째 줄에 친구의 수 N이 주어진다. (1 ≤ N ≤ 10,000)

다음 N개 줄에는 각 친구가 먹을 수 있는 피자의 양이 주어진다. 이 값은 항상 분수이며, 1/4, 1/2, 3/4중 하나이다.

출력

피자를 최소 몇 판 시키면 모든 친구들이 자신이 먹을 수 있는 양만큼 먹는지 출력한다.

예제 입력 1

3
1/2
3/4
3/4

예제 출력 1

3
W3sicHJvYmxlbV9pZCI6IjMyMTMiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWQ1M2NcdWM3OTAiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YzYyNFx1YjI5OFx1Yzc0MCBcdWMwYzFcdWFkZmNcdWM3NzRcdWM3NTggXHVjMGRkXHVjNzdjXHVjNzc0XHViMmU0LiBcdWMwYzFcdWFkZmNcdWM3NzRcdWIyOTQgXHVjZTVjXHVhZDZjXHViNGU0XHVhY2ZjIFx1ZDUzY1x1Yzc5MFx1Yjk3YyBcdWJhMzlcdWM3M2NcdWI3ZWMgXHVhYzE0XHViMmU0LjxcL3A+XHJcblxyXG48cD5cdWMwYzFcdWFkZmNcdWM3NzRcdWM3NTggXHVjZTVjXHVhZDZjXHViNGU0XHVjNzQwIFx1YjllNFx1YzZiMCBcdWM1YjRcdWI4MjRcdWMxMWMgXHVkNTNjXHVjNz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5b25lIGdldHMgZXhhY3QgYW1vdW50IG9mIHBpenphIHRoZXkgd2FudC48XC9wPlxyXG4iLCJpbnB1dCI6IjxwPkZpcnN0IGxpbmUgY29udGFpbnMgYW4gaW50ZWdlciBOLCAxICZsZTsgTiAmbGU7IDEwLDAwMCwgbnVtYmVyIG9mIGZyaWVuZHMuJm5ic3A7PFwvcD5cclxuXHJcbjxwPkluIGVhY2ggb2YgbmV4dCBOIGxpbmVzIHRoZXJlIGlzIGFtb3VudCBvZiBwaXp6YSB0aGF0IGVhY2ggb2YgTWlya28mIzM5O3MgZnJpZW5kcyB3YW50cyB0byBlYXQsIHRoYXQgaXMgdGhlIGZyYWN0aW9uIDFcLzQsIDFcLzIgb3IgM1wvNC4mbmJzcDs8XC9wPlxyXG4iLCJvdXRwdXQiOiI8cD5JbiB0aGUgZmlyc3QgYW5kIG9ubHkgbGluZSB5b3Ugc2hvdWxkIHdyaXRlIHRoZSBtaW5pbWFsIG51bWJlciBvZiBwaXp6YXMgTWlya28gaGFzIHRvIG9yZGVyLiZuYnNwOzxcL3A+XHJcblxyXG48cD4mbmJzcDs8XC9wPlxyXG4iLCJoaW50IjoiIiwib3JpZ2luYWwiOiIxIiwicHJvYmxlbV9sYW5nX2NvZGUiOiJcdWM2MDFcdWM1YjQifV0=

출처

Olympiad > Croatian Highschool Competitions in Informatics > 2004 > National Competition #1 - Seniors 1번

  • 문제를 번역한 사람: baekjoon
  • 빠진 조건을 찾은 사람: dotorya