Jump to content

Solve my homework (or something)

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
vivek

vivek

    Newbie

  • Members
  • Pip
  • 2 posts
N large empty boxes (assume they are of type:1) are initially placed on a table. An
unknown number of boxes (type:1) are selected and in each of them K smaller boxes
(type:2) are placed. Again an unknown number of type:2 boxes are selected and K boxes of
type:3 are placed inside. This process is repeated T times. Now a box is assumed to be
empty when it has no smaller boxes inside it. Finally after all the processes are complete let
there be Fempty boxes in total.
LIMITS
1< N,K,T,F <1000000
Input
First line of the input file contains the number of test cases. Then each line contains 4
integers N,K,T,F as described above.
Output
Each line should contain the total number of boxes on the table.
Example
Input:
1
11 8 2 102
Output:
115



solve it

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
No. It looks far to easy to be worth my time. Perhaps if you post the code you have so far I'll help :)
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Moudi

Moudi

    Programmer

  • Members
  • PipPipPipPip
  • 167 posts
Meh i hate those homeworks that you have to think and not accually code D:
If you show that you're trying someone might accually help

#4
f03nix

f03nix

    Newbie

  • Members
  • Pip
  • 2 posts
This question was a part of a college contest the guy was planning to cheat on :P You had to solve 7 such problems in about 6 hours , the one who solves max wins. ( I know cause i too was in it ... and won )

I managed to solve this question but the selection process seems to be running T+1 times not T (for the given output to match the given input) :/. I recon the problem setter isn't considering the first time we select out of N as one of the T times of the 'process'.