not_working9's blog

By not_working9, history, 5 years ago, In English

recently there was a question to make program by solving the sequence-pattern given in input and output... please try to find it ,and help me if you can .... for every two integer input ,an output was given:

input
(1 4)
(2 3)
(4 10)
(7 10)
(8 100)
(200 300 )
(255 275)
output 5 5 12 7 1043 4048 1060

respectively how can input and output be related here, to each other????

edit : i would like to thank about_30_ninjas for his message ,thanks for solving it .

  • Vote: I like it
  • -13
  • Vote: I do not like it

| Write comment?
»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Ain't nobody got time for that.

»
5 years ago, # |
Rev. 2   Vote: I like it +7 Vote: I do not like it

Here's simple program which solves given task:

#include <iostream>
#include <random>

usnig namespace std;

int main()
{
  int x, y;
  mt19937 rnd;

  while(cin >> x >> y)
    cout << rnd() % 5000 << endl;

  return 0;
}
  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    So what did you sacrifice to become master?

    • »
      »
      »
      5 years ago, # ^ |
        Vote: I like it +9 Vote: I do not like it

      5 stacks of yellow dye in Minecraft.

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    bro ,your solution is wrong , i got the correct answer from about_30_ninjas ... here output is the sum of prime numbers between input range [a b] ... thanks for trying it and giving your time for my question ...

»
5 years ago, # |
  Vote: I like it 0 Vote: I do not like it

You have to be more specific on what type of relationship you're looking for. Any set of input and output values can be fitted perfectly by some polynomial. For example, I could say that the output is (197121089224141 x^5)/14824459483725929637600 - (9060603386308189 x^4)/570171518604843447600 + (26660326915496837687 x^3)/4941486494575309879200 - (1422560370026178478451 x^2)/3706114870931482409400 + (4867386451591739811563 x)/741222974186296481880 - 3706498869439340167/196090733911718646 where x is the sum of the two inputs.