Friday 15 January 2016

Solution of URI 1930 :: Electrical Outlet


Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.

/**Bismillahir Rahmanir Rahim.**/

#include <stdio.h>
int main()
{
    int a,b,c,d,e;
    scanf("%d%d%d%d", &a, &b, &c, &d);
    e=a+b+c+d-3;
    printf("%d\n", e);
    return 0;
}

4 comments:

  1. Thats nice posting..I really enjoyed this sharing.thanks!!!
    exclusive store | online shopping in Pakistan

    ReplyDelete
  2. In our daily routine there is need to buy electrical outlet. In the best dissertation writing service there are many exact same best operate related to these types of products. Your idea is more helpful for me and to the other as well.

    ReplyDelete
  3. will you please describe what logic work on behind it? what is the rules or formula?
    Advance thanks

    ReplyDelete
    Replies
    1. you have four strips and they have following sockets to connect device , but to connect them with each other you will loss three sockets the 4 th one is free because it is not connected to other, so first you have to sum up all the possible way of connection then subtract three that you will lose , and that is the answer

      Delete

Note: only a member of this blog may post a comment.