Skip to content

Instantly share code, notes, and snippets.

@nishidy
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nishidy/b055d85fcc09ae40ee90 to your computer and use it in GitHub Desktop.
Save nishidy/b055d85fcc09ae40ee90 to your computer and use it in GitHub Desktop.
Round 1C 2015: Problem A. Brattleship
T=int(raw_input())
t=0
while t<T:
R,C,W=map(lambda x: int(x), raw_input().split())
a=(C/W)*R+(W-1)+(1 if C%W>0 else 0)
t+=1
print "Case #%d: %d"%(t,a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment