zoukankan      html  css  js  c++  java
  • What are the ages of her children

    Question

                    Tom meets a new neighbor, Christina, next door to him.

    During the conversation with Christina, Tom asks her, “How many kids do you have?”.

    “Three”, replied Christina.

    Tom asked, “How old are they?”

                    Christina answered: “The product of their ages is 36. The sum of their ages are the same as my house number.”.

                    After some time, Tom replied, “I cannot figure it out, I don’t have enough information.”.

                    “My apologies, I forgot to tell you that my youngest child likes strawberry milk.”, replied Christina.          

                    Tom figured out their ages after her answer and Christina confirmed he was right.

                    What are the ages of her children?

    Below is the answer:

    Below is the combination for the product of 36 and their sums:

    • 1 x 2 x 18; 1 + 2 + 18 = 21
    • 1 x 3 x 12; 1 + 3 + 12 = 16
    • 1 x 4 x 9; 1 + 4 + 9 = 14
    • 1 x 6 x 6; 1 + 6 + 6 = 13
    • 2 x 2 x 9; 2 + 2 + 9 = 13
    • 2 x 3 x 6; 2 + 3 + 6 = 11
    • 3 x 3 x 4; 3 + 3 + 4 = 10

    Since Tom cannot determine the answer initially, it means at least 2 combinations will arrive at the same sum (which is the house number).

    From the above, only (1+6+6) and (2+2+9) will arrive at the same sum of 13.

    Christina last statement is that she has a youngest child, so it should be (1+6+6).

  • 相关阅读:
    深入protoBuf
    Golang数据库操纵对IN语句的支持
    golang几种常用配置文件使用方法总结(yaml、toml、json、xml、ini)
    golang实现rabbitmq消息队列失败尝试
    Trie性能分析之敏感词过滤golang
    Go语言cookie的基本操作
    微信二维码添加logo
    gin框架中间件
    gin入门-1
    2017-06-28(passwd 主要组与附属组 gpasswd newgrp groups)
  • 原文地址:https://www.cnblogs.com/ganting/p/4500494.html
Copyright © 2011-2022 走看看