시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB82831828445.955%

문제

오늘은 내가 팬케이크 요리사!

은주는 팬케이크를 만들기로 했다. 은주 앞에는 지금 재료들이 있다. 이 재료들을 보고 있자니, 팬케이크를 최대 몇 개나 만들 수 있을지 궁금해졌다.

팬케이크를 만들기 위해서는 먼저 반죽을 해야 한다. 우유 8컵, 계란 노른자 8개, 설탕 4스푼, 소금 1스푼, 밀가루 9컵이 있으면 팬케이크 반죽 16개를 만들 수 있다. 어떤 0 이상의 실수 x에 대해 모든 재료가 앞에 주어진 양의 x배 이상 있다면 은주는 ⌊16x⌋개의 반죽을 만들 수 있다.

그 다음 반죽에 토핑을 얹고 구우면 팬케이크가 만들어진다. 은주가 만들 수 있는 팬케이크의 종류와 각각에 필요한 토핑의 목록은 다음과 같다.

  • 바나나 팬케이크: 바나나 1개
  • 딸기 팬케이크: 딸기잼 30그램
  • 초콜릿 팬케이크: 초콜릿 스프레드 25그램
  • 호두 팬케이크: 호두 10개

바나나는 여러 조각으로 나누거나 여러 조각을 합쳐서 사용할 수 있다. 예를 들어 1/3 크기의 바나나 조각이 3개 있으면 하나로 합쳐서 바나나 팬케이크를 만들 수 있다.

은주가 가지고 있는 재료들의 양이 주어졌을 때, 만들 수 있는 팬케이크의 최대 개수를 구하는 프로그램을 작성하시오.

입력

첫째 줄에 테스트 케이스의 개수가 주어진다. 각 테스트 케이스는 빈 줄로 구분되며, 두 줄로 이루어져 있다.

테스트케이스의 첫째 줄에는 5개의 정수가 있다. 처음부터 차례대로 cm, y, ssu, ssa, f이다. 은주는 우유 cm컵, 계란 노른자 y개, 설탕 ssu스푼, 소금 ssa스푼, 밀가루 f컵을 가지고 있는 것이다.

두 번째 줄에는 4개의 정수가 있다. 이 수는 b, gs, gc, w이다. 은주는 바나나 b개, 딸기잼 gs그램, 초콜릿 gc그램, 호두 w개가 있다.

주어지는 모든 양은 0보다 크거나 같고, 106보다 작거나 같다.

출력

각 테스트 케이스에 대해 한 줄에 하나의 정수를 출력한다. 이 정수는 은주가 만들 수 있는 팬케이크의 최대 개수이다.

예제 입력 1

2

16 16 8 2 17
10 47 100 19

16 16 8 2 17
10 470 100 19

예제 출력 1

16
30

힌트

  첫 번째 테스트 케이스에서 주어진 재료를 가지고 바나나 팬케익 10개, 딸기 팬케익 1개, 초콜릿 팬케익 4개, 호두 팬케익 1개를 만들 수 있다.

  두 번째 테스트 케이스에서 주어진 재료 중 밀가루가 팬케익 30개를 만들 수 있는 양이다.

W3sicHJvYmxlbV9pZCI6IjI1MjAiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWQzMmNcdWNmMDBcdWM3NzRcdWQwNmMgXHVjMGFjXHViNzkxIiwiZGVzY3JpcHRpb24iOiI8cD5cdWM2MjRcdWIyOThcdWM3NDAgXHViMGI0XHVhYzAwIFx1ZDMyY1x1Y2YwMFx1Yzc3NFx1ZDA2YyBcdWM2OTRcdWI5YWNcdWMwYWMhPFwvcD5cclxuXHJcbjxwPlx1Yzc0MFx1YzhmY1x1YjI5NCBcdWQzMmNcdWNmMDBcdWM3NzRcdWQwNmNcdWI5N2MgXHViOWNjXHViNGU0XHVhZTMwXHViODVjIFx1ZDU4OFx1YjJlNC4gXHVjNzQwXHVjOGZjIFx1YzU1ZVx1YzVkMFx1YjI5NCBcdWM5YzBcdWFlMDggXHVjN2FjXHViOGNjXHViNGU0XHVjNzc0IFx1Yzc4OFx1YjJlNC4gXHVjNzc0IFx1YzdhY1x1YjhjY1x1YjRlNFx1Yzc0NCBcdWJjZjRcdWFjZTAgXHVjNzg4XHVjNzkwXHViMmM4LCBcdWQzMmNcdWNmMDBcdWM3NzRcdWQwNmNcdWI5N2MgXHVjZDVjXHViMzAwIFx1YmE4NyBcdWFjMWNcdWIwOTggXHViOWNjXHViNGU0IFx1YzIxOCBcdWM3ODhcdWM3NDRcdWM5YzAgXHVhZDgxXHVhZTA4XHVkNTc0XHVjODRjXHViMmU0LjxcL3A+XHJcblxyXG48cD5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