math-exercises 3.0.142 → 3.0.144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/calcul/arithmetics/divisibiltyCriteria.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/divisibiltyCriteria.js +10 -7
- package/lib/exercises/math/calculLitteral/equation/equa4.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationFromFrenchDescription.d.ts +10 -0
- package/lib/exercises/math/calculLitteral/equation/equationFromFrenchDescription.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/equationFromFrenchDescription.js +142 -0
- package/lib/exercises/math/calculLitteral/equation/equationFromSentenceExercise.js +3 -3
- package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
- package/lib/exercises/math/functions/affines/affineAdjustment.js +1 -1
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +4 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divisibiltyCriteria.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/divisibiltyCriteria.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;
|
|
1
|
+
{"version":3,"file":"divisibiltyCriteria.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calcul/arithmetics/divisibiltyCriteria.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA+FF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAerD,CAAC"}
|
|
@@ -2,18 +2,21 @@ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exer
|
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { primes } from "../../../../math/numbers/integer/primes.js";
|
|
4
4
|
import { random } from "../../../../utils/alea/random.js";
|
|
5
|
-
const getPropositions = (n, { answer, divisor }) => {
|
|
5
|
+
const getPropositions = (n, { answer, divisor, nb }) => {
|
|
6
6
|
const propositions = [];
|
|
7
7
|
addValidProp(propositions, answer);
|
|
8
|
-
if (divisor !==
|
|
8
|
+
if (divisor !== 2 && nb % 2 !== 0)
|
|
9
9
|
tryToAddWrongProp(propositions, "2");
|
|
10
|
-
if (divisor !==
|
|
10
|
+
if (divisor !== 3 && nb % 3 !== 0)
|
|
11
11
|
tryToAddWrongProp(propositions, "3");
|
|
12
|
-
if (divisor !== 5)
|
|
12
|
+
if (divisor !== 5 && nb % 5 !== 0)
|
|
13
13
|
tryToAddWrongProp(propositions, "5");
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
if (divisor !== 6 && nb % 6 !== 0)
|
|
15
|
+
tryToAddWrongProp(propositions, "6");
|
|
16
|
+
if (divisor !== 9 && nb % 9 !== 0)
|
|
17
|
+
tryToAddWrongProp(propositions, "9");
|
|
18
|
+
if (divisor !== 10 && nb % 10 !== 0)
|
|
19
|
+
tryToAddWrongProp(propositions, "10");
|
|
17
20
|
return shuffleProps(propositions, n);
|
|
18
21
|
};
|
|
19
22
|
const getAnswer = (identifiers) => {
|
|
@@ -87,7 +87,7 @@ const isAnswerValid = (ans, { a, b, c, d }) => {
|
|
|
87
87
|
export const equationType4Exercise = {
|
|
88
88
|
id: "equa4",
|
|
89
89
|
connector: "\\iff",
|
|
90
|
-
label: "Résoudre une équation du type
|
|
90
|
+
label: "Résoudre une équation du type $ax+b=cx+d$",
|
|
91
91
|
isSingleStep: false,
|
|
92
92
|
generator: (nb) => getDistinctQuestions(getEquationType4ExerciseQuestion, nb),
|
|
93
93
|
qcmTimer: 60,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
a: number;
|
|
4
|
+
b: number;
|
|
5
|
+
c: number;
|
|
6
|
+
d: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const equationFromFrenchDescription: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=equationFromFrenchDescription.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equationFromFrenchDescription.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/equationFromFrenchDescription.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAiJF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAoB/D,CAAC"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { rationalVEA } from "../../../../exercises/vea/rationalVEA.js";
|
|
4
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
|
+
import { equationResolutionTex } from "../../../../tree/nodes/equations/equalNode.js";
|
|
6
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
7
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
8
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
9
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
10
|
+
const getPropositions = (n, { answer, a, b, c, d }) => {
|
|
11
|
+
const propositions = [];
|
|
12
|
+
addValidProp(propositions, answer);
|
|
13
|
+
const sol = frac(d - b, a - c).simplify();
|
|
14
|
+
propWhile(propositions, n, () => {
|
|
15
|
+
tryToAddWrongProp(propositions, add(sol, randint(-3, 4, [0]))
|
|
16
|
+
.simplify()
|
|
17
|
+
.toTex());
|
|
18
|
+
});
|
|
19
|
+
return shuffleProps(propositions, n);
|
|
20
|
+
};
|
|
21
|
+
const getAnswer = (identifiers) => {
|
|
22
|
+
const { a, b, c, d } = identifiers;
|
|
23
|
+
return frac(d - b, a - c)
|
|
24
|
+
.simplify()
|
|
25
|
+
.toTex();
|
|
26
|
+
};
|
|
27
|
+
const getInstruction = (identifiers) => {
|
|
28
|
+
const { a, b, c, d } = identifiers;
|
|
29
|
+
const bWord = b > 0 ? "ajoute" : "soustrait";
|
|
30
|
+
const bFullWord = b > 0 ? "m'ajoute" : "me soustrait";
|
|
31
|
+
const dWord = d > 0 ? "ajouté" : "soustrait";
|
|
32
|
+
const multiplyWords = ["double", "triple", "quadruple"];
|
|
33
|
+
return `Je suis un nombre.
|
|
34
|
+
|
|
35
|
+
${a === 1
|
|
36
|
+
? `Si on ${bFullWord} $${Math.abs(b)}$,`
|
|
37
|
+
: `Si on me multiple par $${a}$, puis qu'on ${bWord} $${Math.abs(b)}$ au résultat,`} on trouve mon ${multiplyWords[c - 2]} auquel on a ${dWord} $${Math.abs(d)}$.
|
|
38
|
+
|
|
39
|
+
Qui suis-je ?
|
|
40
|
+
`;
|
|
41
|
+
};
|
|
42
|
+
const getHint = () => {
|
|
43
|
+
return `Note $x$ le nombre recherché, puis écris l'équation correspondant à la situation donnée dans l'énoncé.`;
|
|
44
|
+
};
|
|
45
|
+
const getCorrection = (identifiers) => {
|
|
46
|
+
const { a, b, c, d } = identifiers;
|
|
47
|
+
const bWord = b > 0 ? "ajoute" : "soustrait";
|
|
48
|
+
// const bFullWord = b > 0 ? "m'ajoute" : "me soustrait";
|
|
49
|
+
const dWord = d > 0 ? "ajouté" : "soustrait";
|
|
50
|
+
const multiplyWords = ["double", "triple", "quadruple"];
|
|
51
|
+
return `On note $x$ le nombre recherché.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
${a === 1
|
|
55
|
+
? `Le nombre auquel on ${bWord} $${Math.abs(b)}$`
|
|
56
|
+
: `Le nombre multiplé par $${a}$, auquel on ${bWord} $${Math.abs(b)}$`} vaut :
|
|
57
|
+
|
|
58
|
+
$$
|
|
59
|
+
${add(multiply(a, "x"), b)
|
|
60
|
+
.simplify({ towardsDistribute: true, forbidFactorize: true })
|
|
61
|
+
.toTex()}
|
|
62
|
+
$$
|
|
63
|
+
|
|
64
|
+
Le ${multiplyWords[c - 2]} du nombre auquel on a ${dWord} $${Math.abs(d)}$ vaut :
|
|
65
|
+
|
|
66
|
+
$$
|
|
67
|
+
${add(multiply(c, "x"), d)
|
|
68
|
+
.simplify({ towardsDistribute: true, forbidFactorize: true })
|
|
69
|
+
.toTex()}
|
|
70
|
+
$$
|
|
71
|
+
|
|
72
|
+
On peut donc écrire l'équation :
|
|
73
|
+
|
|
74
|
+
$$
|
|
75
|
+
${add(multiply(a, "x"), b)
|
|
76
|
+
.simplify({ towardsDistribute: true, forbidFactorize: true })
|
|
77
|
+
.toTex()} = ${add(multiply(c, "x"), d)
|
|
78
|
+
.simplify({ towardsDistribute: true, forbidFactorize: true })
|
|
79
|
+
.toTex()}
|
|
80
|
+
$$
|
|
81
|
+
|
|
82
|
+
On résout l'équation :
|
|
83
|
+
|
|
84
|
+
$$
|
|
85
|
+
${equationResolutionTex(a.toTree(), b.toTree(), c.toTree(), d.toTree())}
|
|
86
|
+
$$
|
|
87
|
+
|
|
88
|
+
Le nombre recherché est donc $${getAnswer(identifiers)}$.
|
|
89
|
+
`;
|
|
90
|
+
};
|
|
91
|
+
const getKeys = () => {
|
|
92
|
+
return [];
|
|
93
|
+
};
|
|
94
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
95
|
+
try {
|
|
96
|
+
return rationalVEA(ans, answer, {
|
|
97
|
+
allowDecimal: true,
|
|
98
|
+
allowNonIrreductible: true,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
catch (err) {
|
|
102
|
+
return handleVEAError(err);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const getEquationFromFrenchDescriptionQuestion = () => {
|
|
106
|
+
// pas 1 pour c
|
|
107
|
+
//
|
|
108
|
+
const c = randint(2, 5);
|
|
109
|
+
const a = randint(1, 6, [c]);
|
|
110
|
+
const b = randint(-10, 10, [0]);
|
|
111
|
+
const d = randint(-10, 10, [0]);
|
|
112
|
+
const identifiers = { a, b, c, d };
|
|
113
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
114
|
+
};
|
|
115
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
116
|
+
return {
|
|
117
|
+
answer: getAnswer(identifiers),
|
|
118
|
+
instruction: getInstruction(identifiers),
|
|
119
|
+
keys: getKeys(identifiers),
|
|
120
|
+
answerFormat: "tex",
|
|
121
|
+
identifiers,
|
|
122
|
+
hint: getHint(identifiers),
|
|
123
|
+
correction: getCorrection(identifiers),
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
export const equationFromFrenchDescription = {
|
|
127
|
+
id: "equationFromFrenchDescription",
|
|
128
|
+
label: "Modéliser et résoudre une équation décrite en français",
|
|
129
|
+
isSingleStep: true,
|
|
130
|
+
generator: (nb, opts) => getDistinctQuestions(() => getEquationFromFrenchDescriptionQuestion(opts), nb),
|
|
131
|
+
qcmTimer: 60,
|
|
132
|
+
freeTimer: 60,
|
|
133
|
+
getPropositions,
|
|
134
|
+
isAnswerValid,
|
|
135
|
+
subject: "Mathématiques",
|
|
136
|
+
getInstruction,
|
|
137
|
+
getHint,
|
|
138
|
+
getCorrection,
|
|
139
|
+
getAnswer,
|
|
140
|
+
getQuestionFromIdentifiers,
|
|
141
|
+
hasHintAndCorrection: true,
|
|
142
|
+
};
|
|
@@ -22,14 +22,14 @@ const getInstruction = (identifiers) => {
|
|
|
22
22
|
switch (type) {
|
|
23
23
|
case 1:
|
|
24
24
|
return (instruction +
|
|
25
|
-
|
|
25
|
+
`>${flip ? `Le double` : `La moitié`} du nombre à trouver vaut $${resultNb}$.`);
|
|
26
26
|
case 2:
|
|
27
27
|
return (instruction +
|
|
28
|
-
|
|
28
|
+
`>${flip ? `La somme` : `La différence`} du nombre à trouver et de $${randAdd}$ a pour résultat $${resultNb}$.`);
|
|
29
29
|
case 3:
|
|
30
30
|
default:
|
|
31
31
|
return (instruction +
|
|
32
|
-
|
|
32
|
+
`>${flip ? `Le double` : `La moitié`} du nombre à trouver ${flip ? op2 : op2 + "e"} de $${randAdd}$ vaut $${resultNb}$.`);
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
const getAnswerNode = (identifiers) => {
|
|
@@ -18,4 +18,5 @@ export * from "./equationFromProblem.js";
|
|
|
18
18
|
export * from "./isEqualityTrue.js";
|
|
19
19
|
export * from "./proportionEquation.js";
|
|
20
20
|
export * from "./solveByFactorizingWithIdRmq3.js";
|
|
21
|
+
export * from "./equationFromFrenchDescription.js";
|
|
21
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mCAAmC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/calculLitteral/equation/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC"}
|
|
@@ -59,7 +59,7 @@ const getAnswer = (identifiers) => {
|
|
|
59
59
|
return answer;
|
|
60
60
|
};
|
|
61
61
|
const getAffineAdjustmentQuestion = () => {
|
|
62
|
-
const data = generateLinearData(
|
|
62
|
+
const data = generateLinearData(5);
|
|
63
63
|
data.sort((a, b) => a.x - b.x);
|
|
64
64
|
const xValues = data.map((point) => point.x);
|
|
65
65
|
const yValues = data.map((point) => point.y);
|
package/lib/index.d.ts
CHANGED
|
@@ -538,6 +538,11 @@ declare const mathExercises: (Exercise<{
|
|
|
538
538
|
}> | Exercise<{
|
|
539
539
|
a: number;
|
|
540
540
|
b: number;
|
|
541
|
+
c: number;
|
|
542
|
+
d: number;
|
|
543
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
544
|
+
a: number;
|
|
545
|
+
b: number;
|
|
541
546
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
542
547
|
a: number;
|
|
543
548
|
b: number;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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W,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBAEjB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,aAAa,EACzB,IAAI,CAAC,EAAE,WAAW;IASpB,aAAa,IAAI,oBAAoB;IAQrC,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAmBpC,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE;IAM5C,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAIf,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe;IAQ/B,OAAO;IAIP,OAAO;IAIP,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc;IAqG9C,UAAU,IAAI,aAAa;IAG3B,MAAM,IAAI,OAAO;IAGjB,QAAQ,IAAI,MAAM;IAGlB,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,SAAS;IAMpE,UAAU;CAIX;AAED,eAAO,MAAM,qBAAqB,GAChC,GAAG,aAAa,EAChB,GAAG,aAAa,EAChB,GAAG,aAAa,EAChB,GAAG,aAAa,EAChB,SAAQ,MAAY,sBA+DrB,CAAC"}
|
|
@@ -228,8 +228,10 @@ export const equationResolutionTex = (a, b, c, d, strVar = "x") => {
|
|
|
228
228
|
}
|
|
229
229
|
else {
|
|
230
230
|
//ax + b! = cx + d
|
|
231
|
-
steps.push(`${add(multiply(a, strVar), b)
|
|
232
|
-
.simplify()
|
|
231
|
+
steps.push(`${add(multiply(a, strVar), b)
|
|
232
|
+
.simplify({ towardsDistribute: true, forbidFactorize: true })
|
|
233
|
+
.toTex()}=${add(multiply(c, strVar), d)
|
|
234
|
+
.simplify({ towardsDistribute: true, forbidFactorize: true })
|
|
233
235
|
.toTex()}`);
|
|
234
236
|
iteration(a, (0).toTree(), c, substract(d, b).simplify());
|
|
235
237
|
}
|