Challenge #3: The Pizza Party!


  • Challenge #3: The Pizza Party!

    Please use repl.it to write your code in lua.

    Table of Content

    Part: Name
    Part A Last Question's Editorial
    Part B The Judge Rules
    Part C The Problem Statement
    Part D Constraints
    Part E Input Specifications
    Part F Output Specifications
    Part G Sample Test cases
    Part H Other Informations

    Part A: Last Question's Editorial

    Editorial will not be posted right now. I want to give some other people the chance to solve the problem through other means. It will be posted tomorrow.

    Part B: Judge Rules

    Name Property
    Time Limit 1s - 2s(MAX)
    Memory Limit 64MB
    Problem Type Simple Math

    Like always, you can check your code's execution time and memory by writing:

    local time = os.time();
    -- Code Here
    print("Time: ", os.time() - time);
    print(collectgarbage("count"), "KB");
    

    Part C: The Problem Statement

    WonGuS loves pizza. In fact, he loves it so much that he is throwing a pizza party tonight! However, his guests are very picky about the kind of pizza. When he looks at his guest list, he knows the P number of people likes pepperoni, C number of people who eat cheese pizza, and V number of people who only eat vegetarian pizza. WonGuS knows that 1 pizza is sufficient for 3 people. Help WonGuS figure out the total amount of pizzas he needs to order as well as how many for each pizza.

    Part D : Constraints

    • 0 P ,C ,V 1,000,000,000

    Part E: Input Specifications

    The first line will contain three space separated integers, P, C, and V.

    Part F: Output Specifications

    • The first line will be the Total # of Pizza WonGuS needs to buy
    • The second line will include the Total # of Pepperoni pizza WonGuS needs to buy
    • The third line will include the Total # of Cheese pizza WonGuS needs to buy
    • The fourth line will include the Total # of Vegetarian pizza WonGuS needs to buy

    Part G: Sample Test cases

    // Input 1
    6 7 8
    
    //Output 1
    Total: 8
    Pepperoni: 2
    Cheese: 3
    Vegetarian: 3
    

    Part H: Other Informations

    This should be very easy to solve. Neverthless, Best of Luck!



Log in to reply
 

Looks like your connection to Scripting Helpers was lost, please wait while we try to reconnect.