The problem is from codeforces: http://www.codeforces.com/problemset/problem/151/A
Based on the Note, it is purely a math problem (the equations can be easily derived.)
The Python solution can be easily obtained.
#!/usr/bin/env python s = raw_input().split(" ") n = int(s[0]) k = int(s[1]) l = int(s[2]) c = int(s[3]) d = int(s[4]) p = int(s[5]) nl = int(s[6]) np = int(s[7]) total_drink = k * l total_toasts1 = total_drink / nl total_toasts2 = c * d total_toasts3 = p / np print min(total_toasts1, total_toasts2, total_toasts3) / n
–EOF (The Ultimate Computing & Technology Blog) —
GD Star Rating
loading...
170 wordsloading...
Last Post: __name__ in Python
Next Post: Codeforces: A. Life Without Zeros