#include <stdio.h>
#include <assert.h>
#define PI 3.14f
#define TRIANGLE_PERIMETER(base, height) (0.5 * (base) * (height)) // partial answer to get you started
//... complete the other 5 macros as well
#define RECTANGLE_PERIMETER(width, height) ((width) * (height))
#define SQUARE_PERIMETER(side) ((side) * (side))
#define QUADRILATERAL_PERIMETER(side1, side2, side3, side4) ((side1) + (side2) + (side3) + (side4))
#define CIRCLE_PERIMETER(radius) (2 * PI * (radius))
#define SECTOR_PERIMETER(radius, angle) ((radius) * (angle + 2))
int main(void) {
assert (SQUARE_PERIMETER
(1) == 1); assert (QUADRILATERAL_PERIMETER
(1, 1, 1, 1) == 4); assert (CIRCLE_PERIMETER
(100) == 628); assert (SECTOR_PERIMETER
(1, 1) == 3);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxhc3NlcnQuaD4KCiNkZWZpbmUgUEkgMy4xNGYKICAgIAojZGVmaW5lIFRSSUFOR0xFX1BFUklNRVRFUihiYXNlLCBoZWlnaHQpICgwLjUgKiAoYmFzZSkgKiAoaGVpZ2h0KSkgLy8gcGFydGlhbCBhbnN3ZXIgdG8gZ2V0IHlvdSBzdGFydGVkIAovLy4uLiBjb21wbGV0ZSB0aGUgb3RoZXIgNSBtYWNyb3MgYXMgd2VsbAojZGVmaW5lIFJFQ1RBTkdMRV9QRVJJTUVURVIod2lkdGgsIGhlaWdodCkgKCh3aWR0aCkgKiAoaGVpZ2h0KSkgCiNkZWZpbmUgU1FVQVJFX1BFUklNRVRFUihzaWRlKSAoKHNpZGUpICogKHNpZGUpKSAKI2RlZmluZSBRVUFEUklMQVRFUkFMX1BFUklNRVRFUihzaWRlMSwgc2lkZTIsIHNpZGUzLCBzaWRlNCkgKChzaWRlMSkgKyAoc2lkZTIpICsgKHNpZGUzKSArIChzaWRlNCkpIAojZGVmaW5lIENJUkNMRV9QRVJJTUVURVIocmFkaXVzKSAoMiAqIFBJICogKHJhZGl1cykpIAojZGVmaW5lIFNFQ1RPUl9QRVJ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