3
$\begingroup$

Examples of inputs and outputs:

Input: 3 7 20
Output: 1

Input: 17 2 1651
Output: 34

Input: 4 3 5
Output: 2

Input: 1000000000 1000000000 1000000007
Output: 49

Input: 27 37 100
Output: 99

$\endgroup$
2
  • $\begingroup$ Just clarifying: You looking for a single function f(i, j, k) that produces that output for each of these input sets? $\endgroup$ – Graylocke Sep 3 '20 at 5:06
  • $\begingroup$ @Graylocke Yes. $\endgroup$ – Mark Adel Sep 3 '20 at 5:16
6
$\begingroup$

The function is:

f(a,b,c) = (a*b) %c where % is the modulo operation

How:

f(3,7,20) = 21%20 = 1
f(17,2,1651) = 34%1651 = 34
f(4,3,5) = 12%5 = 2
f(1000000000,1000000000,1000000007) = 10^18 % 1000000007 = 49
f(27,37,100) = 999%100 = 99

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.